db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Invalid XJ215 Error?
Date Thu, 27 Mar 2008 15:49:06 GMT
Daniel John Debrunner wrote:
> Peterson, John wrote:
>> Would you agree that closing the ResultSet when the next() method 
>> returns false is an undesirable side effect which conflicts with the 
>> expected behavior, or have I overlooked something?

Actually in section 15.2.5. of JDBC 4 specification there is this note:

Note – Some JDBC driver implementations may also implicitly close the
ResultSet when the ResultSet type is TYPE_FORWARD_ONLY and the next
method of ResultSet returns false.

So Derby's current behaviour is allowed by the spec.

Note that in the example you show the Blob becomes invalid due to the 
commit, which must be because you are in auto-commit mode. In non-auto 
commit mode the ResultSet would still be closed but the Blob object 
should remain valid until the the transaction is committed or rolled back.


View raw message