You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2011/06/30 00:11:04 UTC

svn commit: r1141274 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java

Author: doogie
Date: Wed Jun 29 22:11:04 2011
New Revision: 1141274

URL: http://svn.apache.org/viewvc?rev=1141274&view=rev
Log:
FIX: In resume(Transaction), there was a block of code commented out
that is supposed to be used on older WebLogic containers.  That code was
actually completely broken.  I've fixed it based on the embedded url,
but can't test it.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java?rev=1141274&r1=1141273&r2=1141274&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java Wed Jun 29 22:11:04 2011
@@ -417,8 +417,8 @@ public class TransactionUtil implements 
 
     public static void resume(Transaction parentTx) throws GenericTransactionException {
         if (parentTx == null) return;
+        TransactionManager txMgr = TransactionFactory.getTransactionManager();
         try {
-            TransactionManager txMgr = TransactionFactory.getTransactionManager();
             if (txMgr != null) {
                 setTransactionBeginStack(popTransactionBeginStackSave());
                 setSetRollbackOnlyCause(popSetRollbackOnlyCauseSave());
@@ -428,12 +428,12 @@ public class TransactionUtil implements 
         } catch (InvalidTransactionException e) {
             /* NOTE: uncomment this for Weblogic Application Server
             // this is a work-around for non-standard Weblogic functionality; for more information see: http://www.onjava.com/pub/a/onjava/2005/07/20/transactions.html?page=3
-            if (parentTx instanceof weblogic.transaction.ClientTransactionManager) {
+            if (txMgr instanceof weblogic.transaction.ClientTransactionManager) {
                 // WebLogic 8 and above
-                ((weblogic.transaction.ClientTransactionManager) parentTx).forceResume(transaction);
-            } else if (parentTx instanceof weblogic.transaction.TransactionManager) {
+                ((weblogic.transaction.ClientTransactionManager) txMgr).forceResume(parentTx);
+            } else if (txMgr instanceof weblogic.transaction.TransactionManager) {
                 // WebLogic 7
-                ((weblogic.transaction.TransactionManager) parentTx).forceResume(transaction);
+                ((weblogic.transaction.TransactionManager) txMgr).forceResume(parentTx);
             } else {
                 throw new GenericTransactionException("System error, could not resume transaction", e);
             }