db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Why close ResultSet & PreparedStatement?
Date Sat, 29 Nov 2008 04:17:15 GMT
>> Is there any point in calling the close method on ResultSet and the
>> close method of PreparedStatement?
> BTW, I'm using embedded mode.  Why won't the garbage collector take
> care of this?

In general, the garbage collector does take care of this.

But there have been bugs in the past, which caused Derby to fail to
collect result sets and statements. For example, DERBY-210, which is
mostly fixed, but still doesn't perfectly collect all resources:

And, as with most garbage-collected items, by closing them yourself
you can accelerate and simplify the process, thus using fewer
resources overall.



View raw message