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

Tests: transactions started must always be commited or rolled back

    XMLWordPrintable

    Details

      Description

      Transactions started in tests always need to be commited or rolled back (especially if an exception is thrown by the code executed inside the transaction).

      Always follow this pattern:

      TransactionHelper.startTransaction();
      try {
        // Code that needs to be executed inside a transaction
        ...
      } finally {
        TransactionHelper.commitOrRollbackTransaction();
      }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 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