Issue Details (XML | Word | Printable)

Key: DERBY-3247
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Daniel John Debrunner
Reporter: Daniel John Debrunner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Activation for a dynamic ResultSet created from an Prepared/CallableStatement will not be closed until garbage collection indicates it is unused to the LCC and the LCC closes it

Created: 04/Dec/07 03:58 PM   Updated: 10/Jan/08 07:43 PM
Return to search
Component/s: JDBC
Affects Version/s: 10.3.1.4, 10.4.1.3
Fix Version/s: 10.3.3.0, 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works derby3247_diff.txt 2007-12-04 05:55 PM Daniel John Debrunner 2 kB

Resolution Date: 10/Jan/08 07:43 PM


 Description  « Hide
In a Java procedure called from SQL any dynamic ResultSets that are created using a PreparedStatement or CallableStatement leave their activations open until :
   - the statement that created it is garbage collected (which requires the outer statement to be garbage collected)
   - and the LCC processes unused Activations.

Dynamic ResultSets that are created by a Statement object are handled correctly because they are marked single use activation and thus the close of the ResultSet also closes the activation.

Fix is to mark the activation as single use in EmbedResultSet when the EmbedResultSet is marked as being a dynamic ResultSet. This will then lead to the close of the ResultSet also closing the activation.

Can't see how to write a test for this, I can see the activations stacking up in a debugger, but typically there will be no visible user impact.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Daniel John Debrunner added a comment - 04/Dec/07 05:55 PM
Patch that marks an Activation for a dynamic EmbedResultSet as single use to ensure it is closed when the ResultSet is closed.

Also add some comments to EmbedStatement.finalize() that indicate it's ok not to handle the result sets in dynamicResults.

Will run tests on the patch but expect them to succeed since this is only moving a close earlier.

Daniel John Debrunner added a comment - 05/Dec/07 04:12 PM
Revision: 601386 applied to trunk.

Daniel John Debrunner added a comment - 10/Jan/08 07:43 PM
To marked fixed in 10.3

Daniel John Debrunner added a comment - 10/Jan/08 07:43 PM
Revision: 610895 in 10.3 branch.