db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: How to return an array of String in a Java routine?
Date Sun, 01 Jun 2008 08:24:23 GMT
sin(EaTing), wrote:
> Hi,
> And one of the tricky point I found in the example is if a ResultSet is 
> returned by a stored procedure, the Statement which generates the 
> ResultSet cannot be closed in the procedure, or the ResultSet won't be 
> returned correctly.
> So in the example ps1 and ps2 is not closed. Quite interesting, should 
> they be garbage collected properly or whether they will cause some 
> transaction problem if they are not closed?


The result sets that are created inside a stored procedure are marked 
with a flag internally, and when such a result set is closed it will 
also close the statement that created it. So there shouldn't be any 
resource leak by using this approach.

Knut Anders

View raw message