openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (OPENJPA-484) H2Dictionary has 'useGetObjectForBlobs' set to true, which should be false
Date Wed, 20 Feb 2008 22:49:43 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Patrick Linskey resolved OPENJPA-484.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.0

> H2Dictionary has 'useGetObjectForBlobs' set to true, which should be false
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-484
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-484
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc, sql
>    Affects Versions: 1.0.1, 1.1.0
>         Environment: H2 Database - v1.0.64, Java SE6
>            Reporter: Prashant Bhat
>             Fix For: 1.1.0
>
>
> From H2 Database forum http://groups.google.com/group/h2-database/browse_thread/thread/fab7dd4424445c9b
> H2Dictionary has 'useGetObjectForBlobs' set to true, whereas the default in DBDictionary
is false. So for an entity with a property of type byte[] which is mapped as blob,  loading
fails because, the 'getBytes' method uses 'rs.getObject(column);' which fails with the following
exception:
> Caused by: java.lang.ClassCastException: java.io.ByteArrayInputStream cannot be cast
to [B
>         at org.apache.openjpa.jdbc.sql.DBDictionary.getBytes(DBDictionary.java:531)
>         at org.apache.openjpa.jdbc.sql.ResultSetResult.getBytesInternal(ResultSetResult.java:278)
>         at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:404)
>         at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:662)
>         at org.apache.openjpa.jdbc.meta.strats.HandlerStrategies.loadDataStore(HandlerStrategies.java:205)
>         at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.load(HandlerFieldStrategy.java:172)
>         at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:796)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:841)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:793)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:483)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116)
>         at org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78)
>         at org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2893)
>         at org.apache.openjpa.kernel.StateManagerImpl.loadField(StateManagerImpl.java:2971)
>         at org.apache.openjpa.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1476)
>         at org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1461)

> I've tried setting 'useGetObjectForBlobs' to false(by just commenting it!), it is working.
So please change this to false.
> Thanks,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message