Hi Prashant Thanks for this this works brilliantly.
David Prashant Bhat wrote:
Sorry! I didn't notice that you're already trying to set useGetObjectForBlobs to false. I tried the following property inside persistence.xml with the latest build(without modifying openjpa:-) and this works for me: <properties> <property name="openjpa.jdbc.DBDictionary" value=" org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)" /> </properties> --- Prashant On Feb 18, 2008 2:51 PM, Prashant Bhat <[EMAIL PROTECTED]> wrote:Hi, I've reported this in issue 484 [1] and a for the solution you've to rebuild openjpa with the line commented which is mentioned there. HTH, Prashant [1] https://issues.apache.org/jira/browse/OPENJPA-484 [2] http://groups.google.com/group/h2-database/browse_thread/thread/fab7dd4424445c9b On Feb 18, 2008 7:55 AM, David Beer <[EMAIL PROTECTED]> wrote:Hi All I am using openjpa-1.0.1 with H2 database. I have an entity which contains the type byte []. I can create and add a value of a byte[] but can't retrieve it as I get this error. <openjpa-1.0.1-r420667:592145 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: java.io.ByteArrayInputStream cannot be cast to [B at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:824) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:723) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load( JDBCStoreManager.java:776) at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:257) at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java :2168) at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:251) at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject (InstanceResultObjectProvider.java:59) at org.apache.openjpa.kernel.QueryImpl.singleResult(QueryImpl.java:1289) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java :1216) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java :990) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java :842) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java :773) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java :525) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:237) at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java :300) at veilig.util.db.DatabaseFunctionsTest.getApplication( DatabaseFunctionsTest.java:123) A bit of googling suggests that I need to overwrite the H2 DBDictionary value for UseGetObjectForBlobs to be false. I tried adding this to my persistence.xml file like so <property name="openjpa.jdbc.DBDictionary" value="H2(useGetObjectForBlobs=false)"/> but then get the error H2 not known. What is the JDBC Dialect that I should be setting? Or Is there a default DBDictonary that I should be using? Thanks David
