[seam-commits] Seam SVN: r9952 - trunk/src/main/org/jboss/seam/util.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Jan 19 08:18:24 EST 2009


Author: cpopetz
Date: 2009-01-19 08:18:24 -0500 (Mon, 19 Jan 2009)
New Revision: 9952

Modified:
   trunk/src/main/org/jboss/seam/util/Work.java
Log:
JBSEAM-3898 Transaction not rolled back by Work if exception is thrown during begin


Modified: trunk/src/main/org/jboss/seam/util/Work.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/Work.java	2009-01-18 16:22:31 UTC (rev 9951)
+++ trunk/src/main/org/jboss/seam/util/Work.java	2009-01-19 13:18:24 UTC (rev 9952)
@@ -36,14 +36,14 @@
       boolean newTransactionRequired = isNewTransactionRequired(transactionActive);
       UserTransaction userTransaction = newTransactionRequired ? transaction : null;
       
-      if (newTransactionRequired) 
-      {
-         log.debug("beginning transaction");
-         userTransaction.begin();
-      }
-      
       try
       {
+         if (newTransactionRequired) 
+         {
+            log.debug("beginning transaction");
+            userTransaction.begin();
+         }
+
          T result = work();
          if (newTransactionRequired) 
          {




More information about the seam-commits mailing list