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

Fix afterTearDown transaction check

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Bug
    • Affects Version/s: 5.8.0-HF08, 5.9.2
    • Fix Version/s: None
    • Component/s: Tests

      Description

      Looks like there is mistake on Transaction committing if started. See diff:

      --- i/nuxeo-core-test/src/main/java/org/nuxeo/ecm/core/test/TransactionalFeature.java
      +++ w/nuxeo-core-test/src/main/java/org/nuxeo/ecm/core/test/TransactionalFeature.java
      @@ -73,13 +73,13 @@ public class TransactionalFeature extends SimpleFeature {
       
           @Override
           public void afterTeardown(FeaturesRunner runner) throws Exception {
      -        if (txStarted == false) {
      +        if (txStarted) {
                   if (TransactionHelper.isTransactionActive()) {
                       try {
                       TransactionHelper.setTransactionRollbackOnly();
                       TransactionHelper.commitOrRollbackTransaction();
                       } finally {
      -                    Logger.getLogger(TransactionalFeature.class).warn("Committing a transaction for your, please do it yourself");
      +                    Logger.getLogger(TransactionalFeature.class).warn("Committing a transaction for you, please do it yourself");
                       }
                   }
                   return;
      
      

      As a result, I get the warning:

      Committing a transaction for you, please do it yourself
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: