You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Andreas Korneliussen (JIRA)" <de...@db.apache.org> on 2006/03/23 11:27:14 UTC

[jira] Updated: (DERBY-787) cursor closed as a sideeffect of closing another cursor with the same name on another connection

     [ http://issues.apache.org/jira/browse/DERBY-787?page=all ]

Andreas Korneliussen updated DERBY-787:
---------------------------------------

    Attachment: DERBY-787.diff
                DERBY-787.stat
                derbyall_report.txt

Attaching the patch for this issue. Removing the check that "UPDATE .. WHERE CURRENT OF .." only can execute against the cursors which comes from the same prepared statement as it was origianlly compiled with.

Testing: Removed the workaround in the SURTests which were added due to this bug. All SURTest will then use the same cursor name, and we will hit this bug if only the testing changes are applied. With the patch, everything works fine.  Also the repro program successfully runs with this patch.

Ran derbyall, and got two failures. In one of the tests, the network server threw a java.net.SocketException: Connection reset exception when shutting down. The other failure is a known regression. These failures are not relevant for this patch.

> cursor closed as a sideeffect of closing another cursor with the same name on another connection
> ------------------------------------------------------------------------------------------------
>
>          Key: DERBY-787
>          URL: http://issues.apache.org/jira/browse/DERBY-787
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.1.2.1
>  Environment: Java 1.4
>     Reporter: Andreas Korneliussen
>     Assignee: Andreas Korneliussen
>  Attachments: CursorIsClosedIssue.java, DERBY-787.diff, DERBY-787.stat, derbyall_report.txt
>
> I was writing some tests for the Scrollable updatable ResultSet feature, and  found some tests failing with 
> ERROR XCL07: Cursor 'SQLCUR0' is closed. Verify that autocommit is OFF.
> in ResultSet.updateRow(). 
> The test does the following:
> 1. set up a connection, and run a query which selects one tuple
> 2. update the tuple using updateXXX and updateRow
> 3. rollback the transaction and close the connection
> Then, repeat the process, however this time use a different string in the query.  This time updateRow() may fail with the error above. 
> The problem has been reproduced on forward only, updatable resultsets.
> Workaround:
> It does not seem to fail if I
> a, set another cursorname on the statement object,
> b, use the same query string.
> I will attach the program to reproduce the problem. Below is the output:
> ~:/<3>db-derby-10.1.2.1-bin/lib> java -cp /home/ak136785/devel/derbytesting/derbytest/build/classes/:derby.jar derbytest.CursorIsClosedIssue
> 1,1,19,Tuple 1
> 2,2,21,Tuple 2
> ERROR XCL07: Cursor 'SQLCUR0' is closed. Verify that autocommit is OFF.
>         at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
>         at org.apache.derby.impl.sql.execute.CurrentOfResultSet.getCursor(Unknown Source)
>         at org.apache.derby.impl.sql.execute.CurrentOfResultSet.openCore(Unknown Source)
>         at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source)
>         at org.apache.derby.impl.sql.execute.NormalizeResultSet.openCore(Unknown Source)
>         at org.apache.derby.impl.sql.execute.UpdateResultSet.setup(Unknown Source)
>         at org.apache.derby.impl.sql.execute.UpdateResultSet.open(Unknown Source)
>         at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(Unknown Source)
>         at derbytest.CursorIsClosedIssue.runTest(CursorIsClosedIssue.java:80)
>         at derbytest.CursorIsClosedIssue.main(CursorIsClosedIssue.java:103)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira