[
https://issues.apache.org/jira/browse/DERBY-3037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12563282#action_12563282
]
Mamta A. Satoor commented on DERBY-3037:
----------------------------------------
Found interesting info in Section 13.1<SQL-client module definition> General
Rules of SQL 2003 specification
4) After the last time that an SQL-agent performs a call of an
<externally-invoked procedure>:
a) A <rollback statement> or a <commit statement> is effectively executed. If
an unrecoverable error has occurred, or if the SQL-agent terminated
unexpectedly, or if any constraint is not satisfied, then a <rollback
statement> is performed. Otherwise, the choice of which of these SQL-statements
to perform is implementation-dependent. If the implementation choice is <commit
statement>, then all holdable cursors are first closed. The determination of
whether an SQL-agent has terminated unexpectedly is implementation-dependent.
b) For every SQL descriptor area that is currently allocated within an
SQL-session associated with the SQL-agent, let D be the <descriptor name> of
that SQL descriptor area; a <deallocate descriptor statement> that specifies
DEALLOCATE DESCRIPTOR D
is effectively executed.
c) All SQL-sessions associated with the SQL-agent are terminated.
I am puzzled by the blurb in 4a)"If the implementation choice is <commit
statement>, then all holdable cursors are first closed. " That seems to
contradict the fact that holdable cursors by definition should be held over the
commit. Also, I am probably misinterpreting 4c)"All SQL-sessions associated
with the SQL-agent are terminated." but does it mean that we close the
resultset associated with call to <externally-invoked procedure>: that is what
my patch is doing.
> 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.