Yes, that was the problem.
If I change my code to keep the Connection open after I have a Blob in
hand, and then read the Blob it works.
It appears that also the ResultSet and PreparedStatement I used to fetch
the Blob must also remain open until I'm done reading the Blob.
That seems reasonable.
Sorry that I didn't see that in the release notes (they are quite big)
as I didn't even realize I was doing this in the code... (my Lob reading
code was buried in some utility classes.)
I believe the Release note entry for this is DERBY-2729 .
Paraphrasing: "Now Blobs and Clobs store their data in temporary files..."
Can I assume that Blob reads (especially for smaller Blobs) will be
slower now because they will have to be copied to temp files?
Thank you very much.
Arthur Blake
Øystein Grøvlen wrote:
Arthur Blake wrote:
Hello, I have been using Apache Derby 10.2.2.0 for a few months, and
it has been working quite well for me.
I upgrade to 10.3.1.4 just after the release came out, and I have been
testing it out with my application.
It seems to work fine, except when I read some BLOB fields from the
database, this Exception is thrown:
java.sql.SQLTransientConnectionException: No current connection.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedBlob.checkValidity(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedBlob.getBytes(Unknown Source)
......
Are you accessing the Blob after the Connection from which is was
obtained has been closed? As described in the release notes for 10.3,
it now required that the Connection is still open in order to access the
Blob. In 10.2, small Blobs may be accessed after the connection is
closed, but not larger Blobs.
Please, check whether the Connection should still be open when the
failure occurs. If not, is it possible for you to change your
application to keep the connection open as long as needed?
--
Øystein