[ 
https://issues.apache.org/jira/browse/DERBY-3037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561831#action_12561831
 ] 

Daniel John Debrunner commented on DERBY-3037:
----------------------------------------------

Two thoughts:

  - What is the purpose of commit() closing the language result sets? If it's 
to close JDBC ResultSets that are marked close at commit then a possibility is 
to only close language result sets that return rows (returnRows() returns 
true). That would leave language result sets that do not return rows open, but 
by definition (I think) those are the ones that are actively executing and the 
very ones we don't want to close. :-)

 - Should commit() be allowed in all routines? I can see a commit makes sense 
in a procedure, to allow a section of logic to be encapsulated in a procedure 
with transaction semantics.  But a commit() in a function seems dubious, what 
should happen when a function performs a commit (or rollback) in the middle of 
a SELECT statement or even worse a DML statement like an INSERT?

> Language ResultSet.finish() is called even when the ResultSet is going to be 
> re-used.
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-3037
>                 URL: https://issues.apache.org/jira/browse/DERBY-3037
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.0.0
>            Reporter: Daniel John Debrunner
>            Assignee: Mamta A. Satoor
>             Fix For: 10.3.2.2, 10.4.0.0
>
>         Attachments: DERBY3037_patch_not_ready_for_commit_v2_diff.txt, 
> DERBY3037_patch_not_ready_for_commit_v2_stat.txt, 
> Derby_3037_AlterTableConstantActionChanges_v1_diff.txt, 
> Derby_3037_AlterTableConstantActionChanges_v1_stat.txt, DERBY_3304_Repro.java
>
>
> DERBY-827 (correctly) changed the lifetime of the language ResultSet tree to 
> be the lifetime of the activation, but did not fix up the correct calls to 
> ResultSet.close() and ResultSet.finish().
> A language ResultSet's lifetime should be driven by the activation, so 
> activation.close() should call finish() on its ResultSet.
> EmbedResultSet should call close on its language ResultSet (theResults field) 
> when the JDBC ResultSet is closed, it should not be calling finish() on its 
> ResultSet.
> See comments in DERBY-827 for some more details and issues.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to