db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3304) Explicit commit inside a java procedure makes a dynamic result sets passed out unavailable
Date Thu, 10 Jan 2008 22:42:34 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557829#action_12557829

Dag H. Wanvik commented on DERBY-3304:

Tried this, but it is not sufficient, it seems..
BaseActivation.reset will close the result set even if holdability is true, cf. this line:

			if (!resultSetHoldability || !resultSet.returnsRows()) {			
				// would really like to check if it is open,
				// this is as close as we can approximate that.

Since CallStatementResultSet extends NoRowsResultSetImpl, the call to resultSet.returnsRows()
returns false, so the second condition holds, and close ensues. NoRowsResultSetImpl#returnsRows
is final so CallStatementResultSet can't really override it. I tried it though, by removing
the final, but then I get an assert error since EmbedStatement#executeStatement, which also
calls ResultSet#returnsRows will now try to create a result set (line 1249 in EmbedStatement.java).
Which is reasonable ;-) 
Maybe the test in BaseActivation.reset can test for CallStatementResultSet? Not OO, though..Thinking
aloud, maybe a new interface method of ResultSet: canReturnDynamicResultSet?

> Explicit commit inside a java procedure makes a dynamic result sets passed out unavailable
> ------------------------------------------------------------------------------------------
>                 Key: DERBY-3304
>                 URL: https://issues.apache.org/jira/browse/DERBY-3304
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions:
>            Reporter: Daniel John Debrunner
>         Attachments: Main.java
> Repro (Main.java) that shows changed behavior after svn 602991
> (the patch committed for this issue). It seems a regression: (originally from Dag H.
Wanvik attached to DERBY-1585)
> An explicit commit inside a stored procedure makes a dynamic result sets passed out unavailable,
even if the commit is executed *prior* to the result set; as in the repro.

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

View raw message