db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peterson, John" <John.Peter...@pega.com>
Subject RE: Invalid XJ215 Error?
Date Thu, 27 Mar 2008 16:45:56 GMT
Thanks for clearing this up for me.


Daniel John Debrunner wrote:

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


-----Original Message-----
From: Peterson, John [mailto:John.Peterson@pega.com] 
Sent: Thursday, March 27, 2008 12:31 PM
To: Derby Discussion
Subject: RE: Invalid XJ215 Error?

I am unable to locate in any JDBC specification
(http://java.sun.com/products/jdbc/download.html#102spec) the
requirement that a ResultSet should be closed when all of the rows
retrieved.  I also do not see this behavior with MSSQL (2000 or 2005),
or with Oracle (9 or 10).  Also, this functionality must have been
recently fixed or added for Derby 10.3 because I did not see this
behavior in Derby 10.2 or 10.1 either.


-----Original Message-----
From: Daniel John Debrunner [mailto:djd@apache.org] 
Sent: Thursday, March 27, 2008 11:24 AM
To: Derby Discussion
Subject: Re: Invalid XJ215 Error?

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?

JDBC 3.0 & early mandated that the result set was closed when all of the

rows have been retrieved, that's the behaviour you are seeing. JDBC 4 
changed the rules for statement completion (in an incompatible way) and 
Derby has not reconciled the behaviour yet. The same code supports all 
the JDBC versions (with additional methods/classes added for newer 
versions) and traditionally the same behaviour was required across JDBC 
versions (e.g. JDBC 3 was a super-set of JDBC 2). No one has addressed 
requiring different behaviour for the same method across different JDBC 
versions. Changing the behaviour for JDBC 4 will also cause backwards 
compatibility issues for applications that change to Java 6.


View raw message