[
https://issues.apache.org/jira/browse/DERBY-3037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562831#action_12562831
]
Mamta A. Satoor commented on DERBY-3037:
----------------------------------------
After doing a little more research, it appears that Derby code is already
closing the resultsets that return rows if the holdability of the resultset is
false. This is done in BaseActivation.reset method. Part of the code in the
reset() method looks as follows
if (!resultSetHoldability || !resultSet.returnsRows())
{
// would really like to check if it is open,
// this is as close as we can approximate that.
resultSet.close();
The first part of the if statement above, which is !resultSetHoldability, will
ensure that we will close all the resultsets(including resultsets that return
rows) that have their holdability set to false.
In the test case attached to this jira(DERBY_3304_Repro.java), we set the
holdability of the JDBC Connection object to false and then create a Java
stored function doConnCommitInt(this function, doConnCommitInt, has a
Connection.commit() inside it.) Next, we execute "values doConnCommitInt()".
Since the holdability of the Connection object is false, the language resultset
that gets created for values doConnCommitInt() also has it's holdability set to
false. Next, when the doConnCommitInt() function does a Connection.commit, we
come to BaseActivation.reset() and the blanket check for !resultSetHoldability
causes Derby to close the language resultset associated with values
doConnCommitInt() and that behavior is incorrect. So, the problem to solve here
is to have additional rule for qualifying the language resultsets for closure.
> 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.