Author: doogie
Date: Thu Apr  8 20:47:42 2010
New Revision: 932104

URL: http://svn.apache.org/viewvc?rev=932104&view=rev
Log:
When rolling back a transaction, and there is already an exception
available, then don't bother logging a new temporary exception.

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=932104&r1=932103&r2=932104&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
 Thu Apr  8 20:47:42 2010
@@ -307,7 +307,7 @@ public class TransactionUtil implements 
      */
     public static void rollback(boolean beganTransaction, String causeMessage, 
Throwable causeThrowable) throws GenericTransactionException {
         if (beganTransaction) {
-            TransactionUtil.rollback();
+            TransactionUtil.rollback(causeThrowable);
         } else {
             TransactionUtil.setRollbackOnly(causeMessage, causeThrowable);
         }
@@ -315,6 +315,11 @@ public class TransactionUtil implements 
 
     /** Rolls back transaction in the current thread IF transactions are 
available */
     public static void rollback() throws GenericTransactionException {
+        rollback(null);
+    }
+
+    /** Rolls back transaction in the current thread IF transactions are 
available */
+    public static void rollback(Throwable causeThrowable) throws 
GenericTransactionException {
         UserTransaction ut = TransactionFactory.getUserTransaction();
 
         if (ut != null) {
@@ -324,7 +329,7 @@ public class TransactionUtil implements 
 
                 if (status != STATUS_NO_TRANSACTION) {
                     //if (Debug.infoOn()) Thread.dumpStack();
-                    if (Debug.infoOn()) {
+                    if (causeThrowable == null && Debug.infoOn()) {
                         Exception newE = new Exception("Stack Trace");
                         Debug.logError(newE, "[TransactionUtil.rollback]", 
module);
                     }


Reply via email to