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.

Dan.

Reply via email to