geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r535017 - /geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/UserTransactionHandler.java
Date Thu, 03 May 2007 23:10:58 GMT
Author: dain
Date: Thu May  3 16:10:58 2007
New Revision: 535017

URL: http://svn.apache.org/viewvc?view=rev&rev=535017
Log:
Only rollback if the Tx is marked rollback or if this is the orginal web request

Modified:
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/UserTransactionHandler.java

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/UserTransactionHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/UserTransactionHandler.java?view=diff&rev=535017&r1=535016&r2=535017
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/UserTransactionHandler.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/UserTransactionHandler.java
Thu May  3 16:10:58 2007
@@ -35,7 +35,6 @@
  * @version $Rev$ $Date$
  */
 public class UserTransactionHandler extends AbstractImmutableHandler {
-
     private final UserTransaction userTransaction;
 
     public UserTransactionHandler(AbstractHandler next, UserTransaction userTransaction)
{
@@ -48,7 +47,7 @@
         try {
             next.handle(target, request, response, dispatch);
         } finally {
-            if (!active && isActive()) {
+             if ((!active && isMarkedRollback()) || (dispatch == REQUEST &&
isActive())) {
                 try {
                     userTransaction.rollback();
                 } catch (SystemException e) {
@@ -77,6 +76,13 @@
         try {
             return !(userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION
                     || userTransaction.getStatus() == Status.STATUS_COMMITTED);
+        } catch (SystemException e) {
+            throw new ServletException("Could not determine transaction status", e);
+        }
+    }
+    private boolean isMarkedRollback() throws ServletException {
+        try {
+            return userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK;
         } catch (SystemException e) {
             throw new ServletException("Could not determine transaction status", e);
         }



Mime
View raw message