1. Derby
  2. DERBY-4198

When using the FOR UPDATE OF clause with SUR (Scroll-insensive updatable result sets), the updateRow() method crashes


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s:,,,,,,,
    • Fix Version/s:,
    • Component/s: JDBC, Network Client, SQL
    • Labels:
    • Urgency:
    • Bug behavior facts:


      This problem occurs on both Client/Server and Embedded.

      With the Embedded driver, the JVM crashes with the following error:
      1) testReproduction( ASSERT FAILED statementContext is not expected to equal statementContexts[0]
      at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.popStatementContext(
      at org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(
      at junit.extensions.TestDecorator.basicRun(
      at junit.extensions.TestSetup$1.protect(
      (It shows a stack trace after this, but I'm attaching the result folders since those are more thorough.)[1]

      On the client driver, the JVM does not crash but it also errors out:
      1) testReproduction( DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.NullPointerExceptionXJ001.U
      (more detail on the log files)[2]

      The error does not show as long as the "OF DATA" isn't specified. It also won't show if the whole FOR UPDATE clause is omitted.

      I would also like some comments and advice on how to proceed on converting holdCursorJDBC30.sql as it is affected by this problem. The original test does an update on a cursor with the "FOR UPDATE OF DATA" clause, and this isn't working on the Java version of the test. Do I go around it by removing the FOR UPDATE clause or should I wait for this bug to get fixed?

      [1] - ErrorOutput_Embedded.tar.gz - Error output files of the Embedded run
      [2] - ErrorOutput_Client.tar.gz - Error output files of the Client/Server run
      [3] - - The reproduction of the errors

      1. ErrorOutput_Client.tar.gz
        149 kB
        Tiago R. Espinha
      2. ErrorOutput_Embedded.tar.gz
        150 kB
        Tiago R. Espinha
        3 kB
        Tiago R. Espinha
      4. derby-4198-throwable.diff
        1 kB
        Dag H. Wanvik
      5. derby-4198-throwable.stat
        0.1 kB
        Dag H. Wanvik
      6. derby-4198-1.diff
        26 kB
        Dag H. Wanvik
      7. derby-4198-1.stat
        1.0 kB
        Dag H. Wanvik
      8. derby-4198-1.diff
        25 kB
        Dag H. Wanvik
      9. derby-4198-1.stat
        0.9 kB
        Dag H. Wanvik
      10. derby-4198-2.diff
        24 kB
        Dag H. Wanvik
      11. derby-4198-2.stat
        0.9 kB
        Dag H. Wanvik
      12. derby-4198-3.stat
        0.9 kB
        Dag H. Wanvik
      13. derby-4198-3.diff
        24 kB
        Dag H. Wanvik
      14. derby-4198-4.diff
        21 kB
        Dag H. Wanvik
      15. derby-4198-4.stat
        0.9 kB
        Dag H. Wanvik

        Issue Links


          No work has yet been logged on this issue.


            • Assignee:
              Dag H. Wanvik
              Tiago R. Espinha
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: