commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12888] - [jelly] JDBC sql result set leak
Date Fri, 27 Sep 2002 17:49:41 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12888>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12888

[jelly] JDBC sql result set leak





------- Additional Comments From kevinj@develop.com  2002-09-27 17:49 -------
Just a comment on the last comment :)

In JDBC 3 closing the connection will close the statement to be closed
automatically, and closing the statemeent will cause the ResultSet to close
automatically. However in JDBC 2 this is not the case. Closing the connection
will close the statement, but closing the stamtement is not guaranteed to close
the ResultSet (a mistake in the spec methinks). But many JDBC 2 drivers do close
the ResultSet if the statement is closed. That's why you should always close the
ResultSet first and then the Statement.

BTW your code wasn't quite right, bit resultset.close and statement.close throw
exceptions, these either need to be caught or re-thrown. The catch handlers for
these typically do nothing (what can you do at this point?)

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message