Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3349

The BatchMode of the ConnectionHelper doesn't work in XA Environment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.2
    • 2.4.3, 2.5.1
    • jackrabbit-core
    • None

    Description

      In XA Environment it's possible that two different Threads are used for prepare() and commit()
      The ConnectionHelper stores the Connection that is used in the DatabaseJournal on a ThreadLocal on prepare()
      On commit() comes a different Thread so the previous used Connection is not on the ThreadLocal
      This is the resulting Thread-Dump

      java.lang.IllegalStateException: not in batch mode
      at org.apache.jackrabbit.core.util.db.ConnectionHelper.endBatch(ConnectionHelper.java:256)
      at org.apache.jackrabbit.core.journal.DatabaseJournal.endBatch(DatabaseJournal.java:513)
      at org.apache.jackrabbit.core.journal.DatabaseJournal.doUnlock(DatabaseJournal.java:501)
      at org.apache.jackrabbit.core.journal.AbstractJournal.unlock(AbstractJournal.java:330)
      at org.apache.jackrabbit.core.journal.AppendRecord.update(AppendRecord.java:279)
      at org.apache.jackrabbit.core.cluster.ClusterNode$WorkspaceUpdateChannel.updateCommitted(ClusterNode.java:664)
      at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:809)
      at org.apache.jackrabbit.core.state.XAItemStateManager.commit(XAItemStateManager.java:181)
      at org.apache.jackrabbit.core.TransactionContext.commit(TransactionContext.java:195)
      at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:326)
      at org.apache.jackrabbit.jca.TransactionBoundXAResource.commit(TransactionBoundXAResource.java:49)

      Attachments

        1. JCR-3349.patch
          6 kB
          Claus Köll

        Issue Links

          Activity

            People

              c_koell Claus Köll
              c_koell Claus Köll
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: