[jboss-cvs] JBossAS SVN: r58989 - trunk/server/src/main/org/jboss/ejb

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 12 05:16:30 EST 2006


Author: dimitris at jboss.org
Date: 2006-12-12 05:16:28 -0500 (Tue, 12 Dec 2006)
New Revision: 58989

Modified:
   trunk/server/src/main/org/jboss/ejb/EnterpriseContext.java
Log:
JBAS-3847, consider an asynchronous rollback due to timeout

Modified: trunk/server/src/main/org/jboss/ejb/EnterpriseContext.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/EnterpriseContext.java	2006-12-12 09:54:33 UTC (rev 58988)
+++ trunk/server/src/main/org/jboss/ejb/EnterpriseContext.java	2006-12-12 10:16:28 UTC (rev 58989)
@@ -1,40 +1,43 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.ejb;
 
-import java.rmi.RemoteException; 
-import java.security.Identity; 
-import java.security.Principal; 
+import java.rmi.RemoteException;
+import java.security.Identity;
+import java.security.Principal;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Properties;
 import java.util.Set;
 import java.util.Stack;
+
 import javax.ejb.EJBContext;
 import javax.ejb.EJBException;
 import javax.ejb.EJBHome;
 import javax.ejb.EJBLocalHome;
-import javax.ejb.TimerService; 
+import javax.ejb.TimerService;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import javax.security.jacc.PolicyContextException;
 import javax.transaction.HeuristicMixedException;
 import javax.transaction.HeuristicRollbackException;
@@ -46,21 +49,19 @@
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import javax.transaction.UserTransaction;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
- 
+
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.SecurityRoleRefMetaData; 
+import org.jboss.metadata.SecurityRoleRefMetaData;
 import org.jboss.security.AuthorizationManager;
 import org.jboss.security.RealmMapping;
 import org.jboss.security.RunAsIdentity;
 import org.jboss.security.SecurityRoleRef;
-import org.jboss.security.SimplePrincipal; 
+import org.jboss.security.SimplePrincipal;
 import org.jboss.security.authorization.AuthorizationContext;
 import org.jboss.security.authorization.EJBResource;
-import org.jboss.security.authorization.ResourceKeys; 
+import org.jboss.security.authorization.ResourceKeys;
 import org.jboss.tm.TransactionTimeoutConfiguration;
 import org.jboss.tm.usertx.client.ServerVMClientUserTransaction;
 
@@ -84,7 +85,7 @@
  * @version $Revision$
  */
 public abstract class EnterpriseContext
-implements AllowedOperationsFlags
+   implements AllowedOperationsFlags
 {
    // Constants -----------------------------------------------------
 
@@ -287,8 +288,7 @@
 
    // Inner classes -------------------------------------------------
 
-   protected class EJBContextImpl
-   implements EJBContext
+   protected class EJBContextImpl implements EJBContext
    {
       /**
        *  A per-bean instance UserTransaction instance cached after the
@@ -455,7 +455,11 @@
             if (tm.getTransaction() == null)
                throw new IllegalStateException("getRollbackOnly() not allowed without a transaction.");
 
-            return tm.getStatus() == Status.STATUS_MARKED_ROLLBACK;
+            // JBAS-3847, consider an asynchronous rollback due to timeout
+            int status = tm.getStatus();
+            return status == Status.STATUS_MARKED_ROLLBACK
+                || status == Status.STATUS_ROLLING_BACK
+                || status == Status.STATUS_ROLLEDBACK;
          }
          catch (SystemException e)
          {




More information about the jboss-cvs-commits mailing list