db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dyre.Tjeldv...@Sun.COM
Subject Re: Momory leak in JDBC driver?
Date Mon, 05 Sep 2005 15:36:28 GMT
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...

>
> I did forget to close one statement.

Does it help to close that statement? If not; I would try to close the
ResultSets to see if that helps...

-- 
dt


Mime
View raw message