openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2344) You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method or after the Blob/Clob's transaction has been committed or rolled back.
Date Fri, 01 Mar 2013 19:27:12 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13590854#comment-13590854
] 

Kevin Sutter commented on OPENJPA-2344:
---------------------------------------

It's not the free'ing of the Blob/Clob, I believe it's the free'ing of the Connection.  OpenJPA
does perform Connection.free() as part of its Connection close processing.  Googling this
type of error shows that Derby did have several issues with their earlier releases relating
to their Locator service and Blobs/Clobs.  Hopefully, those have since been resolved with
the 10.8.2.2 release.

But, the free'ing of the Connection still may be something you need to be aware of due to
their implementation.  As a test, you could try a different OpenJPA ConnectionRetainMode [1].
 The default is on-demand, which may be closing the connection before you have had a chance
to access your Blob/Clob fields.  You could try transaction mode, or even always mode to see
if it gives you better results.

Let's see if this helps before figuring out the next step(s).  Thanks.

[1]  http://people.apache.org/~mikedd/nightly.builds/apache-openjpa-2.3.0-SNAPSHOT/docs/docbook/manual.html#ref_guide_dbsetup_retain
                
> You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free()
method or after the Blob/Clob's transaction has been committed or rolled back.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2344
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2344
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 2.3.0, 2.2.1
>            Reporter: Guillaume Chauvet
>
> Hi,
> We have a problem with OpenJPA (2.2.1) and Derby (10.8.2.2, in server mode). Some of
our entities use blob fields to store binary data, and clob for long string values. When we
start our software and executing a query on the database like "select e form {entity} e" we
get this type of stacktrace :
> <openjpa-2.2.2-QFD-r422266:1446687M fatal general error> org.apache.openjpa.persistence.PersistenceException:
You cannot invoke other java.sql.Clob/java.sql.Blob methods after calling the free() method
or 
> after the Blob/Clob's transaction has been committed or rolled back.
> FailedObject: com.qualiformed.qualinax.platform.dto.control.ConcretePoint-1359472360809003211
[java.lang.String]
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4962)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4922)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
> 	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:86)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:311)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
> 	at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
> 	at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1040)
> 	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:998)
> 	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:920)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1033)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
> 	at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2381)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
> 	at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:60)
> 	at org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:131)
> 	at org.apache.openjpa.lib.rop.AbstractNonSequentialResultList$Itr.hasNext(AbstractNonSequentialResultList.java:171)
> 	at org.apache.openjpa.lib.rop.ResultListIterator.hasNext(ResultListIterator.java:53)
> 	at org.apache.openjpa.kernel.DelegatingResultList$DelegatingListIterator.hasNext(DelegatingResultList.java:389)
> 	at com.qualiformed.qualinax.platform.dao.PointDAO$1.findAll(PointDAO.java:44)
> 	at com.qualiformed.qualinax.application.ihm.administration.DbFilesForm.initialiseModelFile(DbFilesForm.java:1436)
> 	at com.qualiformed.qualinax.application.ihm.MainView$21$16.doInBackground(MainView.java:986)
> 	at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> 	at javax.swing.SwingWorker.run(SwingWorker.java:316)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob
methods after calling the free() method or after the Blob/Clob's transaction has been committed
or rolled back.
> 	at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.Clob.length(Unknown Source)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.getClobString(DBDictionary.java:768)
> 	at org.apache.openjpa.jdbc.sql.ResultSetResult.getStringInternal(ResultSetResult.java:472)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.getString(AbstractResult.java:761)
> 	at org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy.load(StringFieldStrategy.java:160)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:928)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1111)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1084)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1059)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:411)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:306)
> 	... 24 more
> Caused by: org.apache.derby.client.am.SqlException: You cannot invoke other java.sql.Clob/java.sql.Blob
methods after calling the free() method or after the Blob/Clob's transaction has been committed
or 
> rolled back.
> 	at org.apache.derby.client.am.CallableLocatorProcedures.handleInvalidLocator(Unknown
Source)
> 	at org.apache.derby.client.am.CallableLocatorProcedures.clobGetLength(Unknown Source)
> 	at org.apache.derby.client.am.Clob.getLocatorLength(Unknown Source)
> 	at org.apache.derby.client.am.Lob.sqlLength(Unknown Source)
> 	... 35 more
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.sql.SQLException:
The locator that was supplied for this CLOB/BLOB is invalid' was thrown while evaluating an
expression.
> 	at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
> 	at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
> 	at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
> 	at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.executeX(Unknown Source)
> 	... 38 more
> Caused by: org.apache.derby.client.am.SqlException: The locator that was supplied for
this CLOB/BLOB is invalid
> 	... 46 more
> NestedThrowables:
> java.sql.SQLException: The exception 'java.sql.SQLException: The locator that was supplied
for this CLOB/BLOB is invalid' was thrown while evaluating an expression.
> 	at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.Clob.length(Unknown Source)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.getClobString(DBDictionary.java:768)
> 	at org.apache.openjpa.jdbc.sql.ResultSetResult.getStringInternal(ResultSetResult.java:472)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.getString(AbstractResult.java:761)
> 	at org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy.load(StringFieldStrategy.java:160)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:928)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1111)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1084)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1059)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:411)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:306)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
> 	at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
> 	at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1040)
> 	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:998)
> 	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:920)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1033)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
> 	at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2381)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
> 	at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:60)
> 	at org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:131)
> 	at org.apache.openjpa.lib.rop.AbstractNonSequentialResultList$Itr.hasNext(AbstractNonSequentialResultList.java:171)
> 	at org.apache.openjpa.lib.rop.ResultListIterator.hasNext(ResultListIterator.java:53)
> 	at org.apache.openjpa.kernel.DelegatingResultList$DelegatingListIterator.hasNext(DelegatingResultList.java:389)
> 	at com.qualiformed.qualinax.platform.dao.PointDAO$1.findAll(PointDAO.java:44)
> 	at com.qualiformed.qualinax.application.ihm.administration.DbFilesForm.initialiseModelFile(DbFilesForm.java:1436)
> 	at com.qualiformed.qualinax.application.ihm.MainView$21$16.doInBackground(MainView.java:986)
> 	at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> 	at javax.swing.SwingWorker.run(SwingWorker.java:316)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.derby.client.am.SqlException: The exception 'java.sql.SQLException:
The locator that was supplied for this CLOB/BLOB is invalid' was thrown while evaluating an
expression.
> 	at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
> 	at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
> 	at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
> 	at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.executeX(Unknown Source)
> 	at org.apache.derby.client.am.CallableLocatorProcedures.clobGetLength(Unknown Source)
> 	at org.apache.derby.client.am.Clob.getLocatorLength(Unknown Source)
> 	at org.apache.derby.client.am.Lob.sqlLength(Unknown Source)
> 	... 35 more
> Caused by: org.apache.derby.client.am.SqlException: The locator that was supplied for
this CLOB/BLOB is invalid
> 	... 46 more
> java.sql.SQLNonTransientConnectionException: The locator that was supplied for this CLOB/BLOB
is invalid
> 	at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
> 	at org.apache.derby.client.am.Clob.length(Unknown Source)
> 	at org.apache.openjpa.jdbc.sql.DBDictionary.getClobString(DBDictionary.java:768)
> 	at org.apache.openjpa.jdbc.sql.ResultSetResult.getStringInternal(ResultSetResult.java:472)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.getString(AbstractResult.java:761)
> 	at org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy.load(StringFieldStrategy.java:160)
> 	at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:928)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1111)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1084)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1059)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:411)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:306)
> 	at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
> 	at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
> 	at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1040)
> 	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:998)
> 	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:920)
> 	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1033)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
> 	at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2381)
> 	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
> 	at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:60)
> 	at org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:131)
> 	at org.apache.openjpa.lib.rop.AbstractNonSequentialResultList$Itr.hasNext(AbstractNonSequentialResultList.java:171)
> 	at org.apache.openjpa.lib.rop.ResultListIterator.hasNext(ResultListIterator.java:53)
> 	at org.apache.openjpa.kernel.DelegatingResultList$DelegatingListIterator.hasNext(DelegatingResultList.java:389)
> 	at com.qualiformed.qualinax.platform.dao.PointDAO$1.findAll(PointDAO.java:44)
> 	at com.qualiformed.qualinax.application.ihm.administration.DbFilesForm.initialiseModelFile(DbFilesForm.java:1436)
> 	at com.qualiformed.qualinax.application.ihm.MainView$21$16.doInBackground(MainView.java:986)
> 	at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> 	at javax.swing.SwingWorker.run(SwingWorker.java:316)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.derby.client.am.SqlException: The locator that was supplied for
this CLOB/BLOB is invalid
> 	at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
> 	at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source)
> 	at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown Source)
> 	at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown Source)
> 	at org.apache.derby.client.am.PreparedStatement.executeX(Unknown Source)
> 	at org.apache.derby.client.am.CallableLocatorProcedures.clobGetLength(Unknown Source)
> 	at org.apache.derby.client.am.Clob.getLocatorLength(Unknown Source)
> 	at org.apache.derby.client.am.Lob.sqlLength(Unknown Source)
> 	... 35 more
> We tried default openjpa properties configuration but nothing change. We also looked
into OpenJPA to find calls on Blob/Clob free() method, unsuccessfully... Is it normal to not
explicitly free blob/clob fields after reading values ? In any event, I will tried to write
a unitary test as soon as possible.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message