Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-787

cursor closed as a sideeffect of closing another cursor with the same name on another connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.2.1, 10.2.1.6
    • 10.2.1.6
    • SQL
    • None
    • Java 1.4
    • Patch Available

    Description

      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)

      Attachments

        1. derbyall_report.txt
          13 kB
          Andreas Korneliussen
        2. DERBY-787.stat
          0.2 kB
          Andreas Korneliussen
        3. DERBY-787.diff
          3 kB
          Andreas Korneliussen
        4. CursorIsClosedIssue.java
          3 kB
          Andreas Korneliussen

        Activity

          People

            andreask Andreas Korneliussen
            andreask Andreas Korneliussen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: