Derby
  1. Derby
  2. DERBY-4330

NullPointerException or assert failure when re-executing PreparedStatement after lock timeout

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.6.1.0
    • Fix Version/s: 10.3.3.1, 10.4.2.1, 10.5.3.1, 10.6.1.0
    • Component/s: SQL
    • Labels:
      None
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Regression

      Description

      I came across a query that failed with a NullPointerException (insane jars) or an assert failure (sane jars) when a PreparedStatement was re-executed after a lock timeout. I'm able to reproduce this on 10.3.1.4 and later. 10.2.2.0 and earlier don't fail. Another fallout from DERBY-827? I've also seen other manifestations of the problem, apparently depending on the actual rows in the tables, including "No current connection" and "The heap container with container id Container(0, 1120) is closed".

      Stack trace for the assert failure:

      org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED JoinResultSet already open
      at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:120)
      at org.apache.derby.impl.sql.execute.JoinResultSet.openCore(JoinResultSet.java:144)
      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(ProjectRestrictResultSet.java:169)
      at org.apache.derby.impl.sql.execute.SortResultSet.openCore(SortResultSet.java:248)
      at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(ProjectRestrictResultSet.java:169)
      at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(BasicNoPutResultSetImpl.java:248)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:416)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:297)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1235)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1675)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(EmbedPreparedStatement.java:1330)

      1. repro.sql
        2 kB
        Knut Anders Hatlen
      2. derby-4330a.diff
        0.7 kB
        Dag H. Wanvik
      3. repro-union.sql
        0.9 kB
        Dag H. Wanvik
      4. repro-intersect.sql
        0.9 kB
        Dag H. Wanvik
      5. derby-4330b.diff
        21 kB
        Dag H. Wanvik
      6. derby-4330b.stat
        0.6 kB
        Dag H. Wanvik
      7. derby-4330c.diff
        21 kB
        Dag H. Wanvik
      8. derby-4330c.stat
        0.6 kB
        Dag H. Wanvik

        Issue Links

          Activity

          Knut Anders Hatlen created issue -
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Attachment repro.sql [ 12415136 ]
          Knut Anders Hatlen made changes -
          Issue & fix info [Repro attached]
          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-827 [ DERBY-827 ]
          Dag H. Wanvik made changes -
          Attachment derby-4330a.diff [ 12415207 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Repro attached] [Patch Available, Repro attached]
          Dag H. Wanvik made changes -
          Attachment repro-union.sql [ 12415372 ]
          Dag H. Wanvik made changes -
          Attachment repro-intersect.sql [ 12415378 ]
          Dag H. Wanvik made changes -
          Attachment derby-4330b.diff [ 12415498 ]
          Attachment derby-4330b.stat [ 12415499 ]
          Dag H. Wanvik made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Dag H. Wanvik made changes -
          Attachment derby-4330c.diff [ 12415536 ]
          Attachment derby-4330c.stat [ 12415537 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Repro attached, Patch Available] [Repro attached]
          Dag H. Wanvik made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 10.3.4.0 [ 12313653 ]
          Fix Version/s 10.4.3.0 [ 12313654 ]
          Fix Version/s 10.5.3.1 [ 12314154 ]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Resolution Fixed [ 1 ]
          Dag H. Wanvik made changes -
          Fix Version/s 10.5.3.1 [ 12314182 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dag H. Wanvik made changes -
          Fix Version/s 10.5.4.0 [ 12314154 ]
          Dag H. Wanvik made changes -
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.4.3.0 [ 12313654 ]
          Dag H. Wanvik made changes -
          Fix Version/s 10.3.3.1 [ 12313143 ]
          Fix Version/s 10.3.4.0 [ 12313653 ]
          Gavin made changes -
          Workflow jira [ 12472056 ] Default workflow, editable Closed status [ 12799036 ]

            People

            • Assignee:
              Dag H. Wanvik
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development