Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
10.9.1.0
-
Normal
-
High Value Fix, Newcomer, Repro attached, Workaround attached
-
Embedded/Client difference
Description
If a Blob or Clob is freed implicitly in the client driver, calling free explicitly afterwards will throw an exception. Instead, this should probably be a no-op.
To reproduce, do something like this:
con.setAutoCommit(false);
Clob c = con.createClob();
con.commit();
c.free();
==>
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(CallableLocatorProcedures.java:1071)
at org.apache.derby.client.am.CallableLocatorProcedures.clobReleaseLocator(CallableLocatorProcedures.java:664)
at org.apache.derby.client.am.Clob.free(Clob.java:844)
... 38 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(Statement.java:1604)
at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(NetStatementReply.java:322)
at org.apache.derby.client.net.NetStatementReply.readExecuteCall(NetStatementReply.java:106)
at org.apache.derby.client.net.StatementReply.readExecuteCall(StatementReply.java:75)
at org.apache.derby.client.net.NetStatement.readExecuteCall_(NetStatement.java:175)
at org.apache.derby.client.am.Statement.readExecuteCall(Statement.java:1570)
at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2156)
at org.apache.derby.client.am.PreparedStatement.executeX(PreparedStatement.java:1599)
at org.apache.derby.client.am.CallableLocatorProcedures.clobReleaseLocator(CallableLocatorProcedures.java:662)
... 39 more
Caused by: org.apache.derby.client.am.SqlException: The locator that was supplied for this CLOB/BLOB is invalid
... 48 more
The problem dosen't exist in the embedded driver.
The immediate cause seems to be that the client driver state becomes out of sync with the server side. This may be fixable by dealing specifically witht the invalid locator exception in free().