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

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Nov 11 04:41:19 EST 2008


Author: shane.bryzak at jboss.com
Date: 2008-11-11 04:41:19 -0500 (Tue, 11 Nov 2008)
New Revision: 9550

Modified:
   trunk/src/main/org/jboss/seam/util/Work.java
Log:
JBSEAM-3519

Modified: trunk/src/main/org/jboss/seam/util/Work.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/Work.java	2008-11-11 07:26:50 UTC (rev 9549)
+++ trunk/src/main/org/jboss/seam/util/Work.java	2008-11-11 09:41:19 UTC (rev 9550)
@@ -1,13 +1,11 @@
 package org.jboss.seam.util;
 
-import static org.jboss.seam.ComponentType.JAVA_BEAN;
 import static org.jboss.seam.util.EJB.APPLICATION_EXCEPTION;
 import static org.jboss.seam.util.EJB.rollback;
 
 import javax.transaction.Status;
 import javax.transaction.UserTransaction;
 
-import org.jboss.seam.Component;
 import org.jboss.seam.annotations.ApplicationException;
 import org.jboss.seam.log.LogProvider;
 import org.jboss.seam.log.Logging;
@@ -31,10 +29,12 @@
    
    public final T workInTransaction() throws Exception
    {      
-      boolean transactionActive = Transaction.instance().isActiveOrMarkedRollback()
-              || Transaction.instance().isRolledBack(); //TODO: temp workaround, what should we really do in this case??
+      org.jboss.seam.transaction.UserTransaction transaction = Transaction.instance();
+      
+      boolean transactionActive = transaction.isActiveOrMarkedRollback()
+              || transaction.isRolledBack(); //TODO: temp workaround, what should we really do in this case??
       boolean newTransactionRequired = isNewTransactionRequired(transactionActive);
-      UserTransaction userTransaction = newTransactionRequired ? Transaction.instance() : null;
+      UserTransaction userTransaction = newTransactionRequired ? transaction : null;
       
       if (newTransactionRequired) 
       {
@@ -47,7 +47,7 @@
          T result = work();
          if (newTransactionRequired) 
          {
-            if (Transaction.instance().isMarkedRollback())
+            if (transaction.isMarkedRollback())
             {
                log.debug("rolling back transaction");
                userTransaction.rollback(); 




More information about the seam-commits mailing list