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

Transaction synchronisation should only be registered if the transaction is active

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6.0-HF09, 5.7.1
    • Component/s: Core

      Description

      In the TransactionalCoreSessionWrapper, the following code is wrong at least when the transaction status is STATUS_ROLLEDBACK, in which case the synchronisation should not be registered.

      main = TransactionHelper.lookupTransactionManager().getTransaction();
      if (main != null) {
          if (main.getStatus() != Status.STATUS_MARKED_ROLLBACK) {
              main.registerSynchronization(this);
              session.afterBegin();
              threadBound.set(main);
          }
      }
      

      The test should probably be the following:

      if (main.getStatus() == Status.STATUS_ACTIVE) {
        ...
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ataillefer Antoine Taillefer
                Reporter:
                ataillefer Antoine Taillefer
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h