Derby
  1. Derby
  2. DERBY-4731

XA two phase commit with active GLOBAL TEMPORARY TABLE causes An internal error identified by RawStore module

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.7.1.1
    • Component/s: JDBC
    • Labels:
      None
    • Issue & fix info:
      High Value Fix, Repro attached, Workaround attached
    • Bug behavior facts:
      Crash, Deviation from standard, Seen in production

      Description

      If an XA two phase commit is performed while an GLOBAL TEMPORARY TABLE is active, it will fail with:
      XAER_RMERR
      Exception in thread "main" javax.transaction.xa.XAException: An internal error w
      as identified by RawStore module.
      at org.apache.derby.jdbc.EmbedXAResource.wrapInXAException(EmbedXAResour
      ce.java:820)
      at org.apache.derby.jdbc.EmbedXAResource.commit(EmbedXAResource.java:143
      )
      at ReproXATempTable.tempTableInXA(ReproXATempTable.java:51)
      at ReproXATempTable.main(ReproXATempTable.java:14)
      Caused by: java.sql.SQLTransactionRollbackException: An internal error was ident
      ified by RawStore module.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLE
      xceptionFactory40.java:88)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)

      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException
      (TransactionResourceImpl.java:391)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Tr
      ansactionResourceImpl.java:346)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConne
      ction.java:2269)
      at org.apache.derby.impl.jdbc.EmbedConnection.xa_commit(EmbedConnection.
      java:2924)
      at org.apache.derby.jdbc.XATransactionState.xa_commit(XATransactionState
      .java:339)
      at org.apache.derby.jdbc.EmbedXAResource.commit(EmbedXAResource.java:141
      )
      ... 2 more
      Caused by: java.sql.SQLException: An internal error was identified by RawStore m
      odule.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExc
      eptionFactory.java:45)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransport
      AcrossDRDA(SQLExceptionFactory40.java:119)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLE
      xceptionFactory40.java:70)
      ... 9 more
      Caused by: ERROR 40XT0: An internal error was identified by RawStore module.
      at org.apache.derby.iapi.error.StandardException.newException(StandardEx
      ception.java:276)
      at org.apache.derby.impl.store.raw.xact.Xact.setActiveState(Xact.java:18
      09)
      at org.apache.derby.impl.store.raw.xact.Xact.addContainer(Xact.java:1357
      )
      at org.apache.derby.impl.store.access.heap.Heap.create(Heap.java:274)
      at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.creat
      eConglomerate(HeapConglomerateFactory.java:195)
      at org.apache.derby.impl.store.access.RAMTransaction.createConglomerate(
      RAMTransaction.java:823)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.clean
      upTempTableOnCommitOrRollback(GenericLanguageConnectionContext.java:1345)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doCom
      mit(GenericLanguageConnectionContext.java:1263)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.xaCom
      mit(GenericLanguageConnectionContext.java:1160)
      at org.apache.derby.impl.jdbc.EmbedConnection.xa_commit(EmbedConnection.
      java:2921)
      ... 4 more

      See attached program for reproduction.
      javac -g ReproXATempTable.java utilXid.java
      java ReproXATempTable

      To work around the issue, you can drop the temp table before ending the xa transaction.

      1. utilXid.java
        1 kB
        Kathey Marsden
      2. ReproXATempTableAssert.java
        6 kB
        Kathey Marsden
      3. ReproXATempTable.java
        6 kB
        Kathey Marsden
      4. derby_4731.diff
        8 kB
        Mike Matrigali
      5. derby_4731_3.diff
        9 kB
        Mike Matrigali
      6. derby_4731_2.diff
        14 kB
        Mike Matrigali
      7. backport10_3.diff
        12 kB
        Mike Matrigali

        Issue Links

          Activity

          Kathey Marsden created issue -
          Kathey Marsden made changes -
          Field Original Value New Value
          Attachment ReproXATempTable.java [ 12448589 ]
          Attachment utilXid.java [ 12448590 ]
          Kathey Marsden made changes -
          Attachment ReproXATempTableAssert.java [ 12448606 ]
          Mike Matrigali made changes -
          Assignee Mike Matrigali [ mikem ]
          Mike Matrigali made changes -
          Attachment derby_4731.diff [ 12448647 ]
          Mike Matrigali made changes -
          Attachment derby_4731_2.diff [ 12448836 ]
          Mike Matrigali made changes -
          Bug behavior facts [Crash] [Crash, Deviation from standard, Seen in production]
          Issue & fix info [Repro attached, High Value Fix, Workaround attached] [High Value Fix, Patch Available, Repro attached, Workaround attached]
          Mike Matrigali made changes -
          Fix Version/s 10.7.0.0 [ 12314971 ]
          Mike Matrigali made changes -
          Attachment backport10_3.diff [ 12449363 ]
          Mike Matrigali made changes -
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.5.3.1 [ 12314182 ]
          Fix Version/s 10.6.1.1 [ 12314973 ]
          Issue & fix info [High Value Fix, Patch Available, Repro attached, Workaround attached] [High Value Fix, Repro attached, Workaround attached]
          Mike Matrigali made changes -
          Link This issue relates to DERBY-4735 [ DERBY-4735 ]
          Mike Matrigali made changes -
          Link This issue blocks DERBY-4743 [ DERBY-4743 ]
          Mike Matrigali made changes -
          Attachment derby_4731_3.diff [ 12449460 ]
          Mike Matrigali made changes -
          Affects Version/s 10.4.2.0 [ 12313345 ]
          Affects Version/s 10.6.1.0 [ 12313727 ]
          Affects Version/s 10.5.3.0 [ 12314117 ]
          Mike Matrigali made changes -
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.5.3.1 [ 12314182 ]
          Fix Version/s 10.6.1.1 [ 12314973 ]
          Affects Version/s 10.6.1.0 [ 12313727 ]
          Affects Version/s 10.5.3.0 [ 12314117 ]
          Affects Version/s 10.4.2.0 [ 12313345 ]
          Mike Matrigali made changes -
          Fix Version/s 10.6.1.1 [ 12314973 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 10.3.3.1 [ 12313143 ]
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.5.3.1 [ 12314182 ]
          Kathey Marsden made changes -
          Fix Version/s 10.6.2.0 [ 12315342 ]
          Fix Version/s 10.6.1.1 [ 12314973 ]
          Knut Anders Hatlen made changes -
          Fix Version/s 10.6.2.1 [ 12315343 ]
          Fix Version/s 10.6.2.0 [ 12315342 ]
          Rick Hillegas made changes -
          Affects Version/s 10.7.1.1 [ 12315564 ]
          Affects Version/s 10.7.1.0 [ 12314971 ]
          Fix Version/s 10.7.1.1 [ 12315564 ]
          Fix Version/s 10.7.1.0 [ 12314971 ]
          Kathey Marsden made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12514859 ] Default workflow, editable Closed status [ 12800476 ]

            People

            • Assignee:
              Mike Matrigali
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development