db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Momory leak in JDBC driver?
Date Tue, 06 Sep 2005 16:37:23 GMT
Dyre.Tjeldvoll@Sun.COM wrote:

> Wei Jiang <_weijiang_@yahoo.com> writes:
>>java.sql javadoc says:
>>Note: A Statement object is automatically closed when it is garbage collected.
>>When a Statement object is closed, its current ResultSet object, if one exists,
>>is also closed.
>>I do not close ResultSet. But I do close Statement. Is it possible that
>>when derby's Statement closed, the ResultSet is not?
> Can't say, but what I do know is that when you RE-EXECUTE a statement
> you get a new ResultSet, but you don't automatically close the previous
> ResultSet. So if you create multiple ResultSets from the same
> statement before you close it, ResultSets will be leaked, at least
> temporarily.
> I have been told that this is incorrect according to the JDBC
> specification...

Are you saying Derby client driver does not close any existing
ResultSet's that were generated by the Statement when the Statement is
re-executed? That would indeed be against the JDBC spec, I know the
embedded driver does close existing ResultSets.


View raw message