Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-30650

TransactionHelper.commitOrRollback may silently fail on DBS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.10, 2021.0
    • Fix Version/s: 2021.x
    • Component/s: Core DBS

      Description

      On DBS when the session is not saved a call to TransactionHelper.commitOrRollback might return without throwing an error while nothing has been committed on the backend.
      In this specific case, the transaction manager (geronimo) is performing the backend request during an afterCompletion hook, if there is an error (like concurrent exception) it is traced as a WARN and not propagated.

      Here an example of such case:

      2021-10-06T21:05:24,761 WARN  [Transaction] Unexpected exception from afterCompletion; continuing
      org.nuxeo.ecm.core.api.ConcurrentUpdateException: E11000 duplicate key error collection: nuxeo.default index: ecm:id_1 dup key: { ecm:id: "0816c2c2-db01-5989-ab83-06bd1da46ebb" }, Concurrent update
          at org.nuxeo.ecm.core.storage.mongodb.MongoDBRepository.createStates(MongoDBRepository.java:562) ~[nuxeo-core-storage-mongodb-10.10-HF49.jar:?]
          at org.nuxeo.ecm.core.storage.dbs.DBSCachingRepository.createStates(DBSCachingRepository.java:217) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?]
          at org.nuxeo.ecm.core.storage.dbs.DBSTransactionState.save(DBSTransactionState.java:824) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?]
          at org.nuxeo.ecm.core.storage.dbs.DBSTransactionState.commit(DBSTransactionState.java:1129) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?]
          at org.nuxeo.ecm.core.storage.dbs.DBSSession.commit(DBSSession.java:245) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?]
          at org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase$TransactionContext.afterCompletion(DBSRepositoryBase.java:481) ~[nuxeo-core-storage-dbs-10.10-HF52.jar:?]
          at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:540) ~[geronimo-transaction-2.2.1.jar:2.2.1]
          at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:533) ~[geronimo-transaction-2.2.1.jar:2.2.1]
          at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:329) ~[geronimo-transaction-2.2.1.jar:2.2.1]
          at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) ~[geronimo-transaction-2.2.1.jar:2.2.1]
          at org.nuxeo.runtime.jtajca.NuxeoContainer$UserTransactionImpl.commit(NuxeoContainer.java:538) ~[nuxeo-runtime-jtajca-10.10-HF41.jar:?]
          at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:422) ~[nuxeo-runtime-jtajca-10.10-HF41.jar:?]
      

      The workaround is to make sure the session is saved Session#save before commit.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bdelbosc Benoit Delbosc
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: