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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

doogie-3
Author: doogie
Date: Thu Nov 26 01:33:03 2009
New Revision: 884362

URL: http://svn.apache.org/viewvc?rev=884362&view=rev
Log:
for all doTransaction helpers, change Throwable to
GenericEntityException.

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=884362&r1=884361&r2=884362&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 Nov 26 01:33:03 2009
@@ -52,6 +52,7 @@
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.GenericEntityException;
 
 /**
  * <p>Transaction Utility to help with some common transaction tasks
@@ -73,11 +74,11 @@
     private static ThreadLocal<Timestamp> transactionStartStamp = new ThreadLocal<Timestamp>();
     private static ThreadLocal<Timestamp> transactionLastNowStamp = new ThreadLocal<Timestamp>();
 
-    public static <V> V doNewTransaction(String ifErrorMessage, Callable<V> callable) throws Throwable {
+    public static <V> V doNewTransaction(String ifErrorMessage, Callable<V> callable) throws GenericEntityException {
         return doNewTransaction(ifErrorMessage, true, callable);
     }
 
-    public static <V> V doNewTransaction(String ifErrorMessage, boolean printException, Callable<V> callable) throws Throwable {
+    public static <V> V doNewTransaction(String ifErrorMessage, boolean printException, Callable<V> callable) throws GenericEntityException {
         Transaction tx = TransactionUtil.suspend();
         try {
             return doTransaction(ifErrorMessage, printException, callable);
@@ -86,11 +87,11 @@
         }
     }
 
-    public static <V> V doTransaction(String ifErrorMessage, Callable<V> callable) throws Throwable {
+    public static <V> V doTransaction(String ifErrorMessage, Callable<V> callable) throws GenericEntityException {
         return doTransaction(ifErrorMessage, true, callable);
     }
 
-    public static <V> V doTransaction(String ifErrorMessage, boolean printException, Callable<V> callable) throws Throwable {
+    public static <V> V doTransaction(String ifErrorMessage, boolean printException, Callable<V> callable) throws GenericEntityException {
         boolean tx = TransactionUtil.begin();
         Throwable transactionAbortCause = null;
         try {
@@ -110,7 +111,7 @@
             throw e;
         } catch (Throwable t) {
             transactionAbortCause = t;
-            throw t;
+            throw new GenericEntityException(t);
         } finally {
             if (transactionAbortCause == null) {
                 TransactionUtil.commit(tx);