[EMAIL PROTECTED] wrote:

> Wei Jiang <[EMAIL PROTECTED]> 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.

Dan.

Reply via email to