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:

For each data source definition in the semarchy.xml file, add the following property:

connectionProperties="oracle.jdbc.J2EE13Compliant=true"

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" />