JPA (EclipseLink 2.3.x) を使用して、イメージByte[]
とスケジューラを Oracle 11g データベースに保持しようとしています。TimerHandle
プロパティの値が null でない場合、JPA は Byte[]/TimerHandle をデータベースに永続化できましたが、それらのプロパティがnull
の場合、この例外が発生します。
Caused by: java.lang.ClassCastException: oracle.sql.BLOB incompatible with oracle.sql.BLOB
at oracle.jdbc.driver.OraclePreparedStatement.setBlob(OraclePreparedStatement.java:6663)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.setBlob(OraclePreparedStatementWrapper.java:128)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBlob(DelegatingPreparedStatement.java:387)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.setBlob(LoggingConnectionDecorator.java:1499)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setBlob(DelegatingPreparedStatement.java:387)
at org.apache.openjpa.jdbc.sql.OracleDictionary.setNull(OracleDictionary.java:633)
at org.apache.openjpa.jdbc.sql.DBDictionary.setTyped(DBDictionary.java:1285)
at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:896)
at org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:856)
at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:117)
at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.batchOrExecuteRow(BatchingPreparedStatementManagerImpl.java:99)
at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:83)
at com.ibm.ws.persistence.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:63)
at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:100)
at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:88)
at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550)
at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:105)
at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:78)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:737)
at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2178)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2076)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1847)
... 70 more
null
データベースで (null) としてデータベースに永続化できるように、この問題を修正するにはどうすればよいですか?