Upgrade to 5.1 - Oracle J2EE Compliance Issue

Problem

You have just upgraded to v5.1 deployed on an Oracle database. On using the Application you get the following error message in the PDE log:

com.semarchy.mdm.runtime.data.InvalidDataAccessResourceUsageException: java.lang.RuntimeException: Unexpected DB value 2019-05-21 13:57:01.273 (Class oracle.sql.TIMESTAMP for logicalType TIMESTAMP)

Solution

This is how you would resolve the issue:

  1. For each datasource defintion in the semarchy.xml file
  2. Add the following property

    connectionProperties="oracle.jdbc.J2EE13Compliant=true"
  3. For example:

    <Resource name="jdbc/SEMARCHY_REPOSITORY" auth="Container" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
    		type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="XXX"
    		username="XXX" password="XXX" maxActive="8" maxIdle="8" minIdle="0"
    		maxWait="15000" initialSize="1" defaultAutoCommit="false" rollbackOnReturn="true" 
            validationQuery="select 1 from dual" testOnBorrow="true"
    		connectionProperties="oracle.jdbc.J2EE13Compliant=true"
    		timeBetweenEvictionRunsMillis="45000" validationInterval="60000" />