[jboss-cvs] JBossAS SVN: r110118 - in branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432: transaction/src/main/org/jboss/tm and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 21 23:41:28 EST 2010


Author: jbertram at redhat.com
Date: 2010-12-21 23:41:28 -0500 (Tue, 21 Dec 2010)
New Revision: 110118

Modified:
   branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/testsuite/src/main/org/jboss/test/tm/test/TransactionManagerUnitTestCase.java
   branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java
Log:
JBPAPP-5432

Modified: branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/testsuite/src/main/org/jboss/test/tm/test/TransactionManagerUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/testsuite/src/main/org/jboss/test/tm/test/TransactionManagerUnitTestCase.java	2010-12-22 04:19:04 UTC (rev 110117)
+++ branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/testsuite/src/main/org/jboss/test/tm/test/TransactionManagerUnitTestCase.java	2010-12-22 04:41:28 UTC (rev 110118)
@@ -549,7 +549,7 @@
          new Operation(Operation.ENLIST, 1),
          new Operation(Operation.STATE, 1, Resource.ACTIVE),
          new Operation(Operation.SETSTATUS, 1, XAException.XA_HEURRB),
-         new Operation(Operation.COMMIT, 1, 0,new HeuristicRollbackException()),
+         new Operation(Operation.COMMIT, 1, 0,new RollbackException()),
          new Operation(Operation.STATE, 1, Resource.FORGOT),
       });
    }

Modified: branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java
===================================================================
--- branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java	2010-12-22 04:19:04 UTC (rev 110117)
+++ branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java	2010-12-22 04:41:28 UTC (rev 110118)
@@ -370,7 +370,8 @@
             Throwable causedByThrowable = cause;
             rollbackResources();
             completeTransaction();
-            checkHeuristics();
+            if (getCommitStrategy() == 2)
+               checkHeuristics();
             // throw jboss rollback exception with the saved off cause
             throw new JBossRollbackException("Unable to commit, tx=" +
                   toString() + " status=" + getStringStatus(status),
@@ -1888,7 +1889,10 @@
     */
    private int getCommitStrategy()
    {
-      int resourceCount = resources.size();
+      int resourceCount = 0;
+
+      if (resources != null)
+         resourceCount = resources.size();
       
       if (resourceCount == 0)
          return 0;



More information about the jboss-cvs-commits mailing list