[jboss-cvs] JBoss Messaging SVN: r8451 - in branches/Branch_1_4/src/main/org/jboss/jms: tx and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 19 00:38:20 EDT 2011


Author: gaohoward
Date: 2011-10-19 00:38:20 -0400 (Wed, 19 Oct 2011)
New Revision: 8451

Modified:
   branches/Branch_1_4/src/main/org/jboss/jms/client/container/SessionAspect.java
   branches/Branch_1_4/src/main/org/jboss/jms/tx/ClientTransaction.java
Log:
JBMESSAGING-1900
remove the synchronized block and make the rollbackOnly volatile


Modified: branches/Branch_1_4/src/main/org/jboss/jms/client/container/SessionAspect.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/client/container/SessionAspect.java	2011-10-19 04:06:21 UTC (rev 8450)
+++ branches/Branch_1_4/src/main/org/jboss/jms/client/container/SessionAspect.java	2011-10-19 04:38:20 UTC (rev 8451)
@@ -421,50 +421,43 @@
    { 
       MethodInvocation mi = (MethodInvocation)invocation;
       SessionState state = getState(invocation);
-      
-      boolean result = true;
-      
-      synchronized (state)
-      {
-      
-         int ackMode = state.getAcknowledgeMode();
+
+      int ackMode = state.getAcknowledgeMode();
                   
-         if (ackMode == Session.CLIENT_ACKNOWLEDGE)
+      if (ackMode == Session.CLIENT_ACKNOWLEDGE)
+      {
+         if (trace)
          {
-            if (trace)
-            {
-               log.trace("Don't do anything about CLIENT_ACK mode");
-            }
+            log.trace("Don't do anything about CLIENT_ACK mode");
          }
-         else if (ackMode == Session.AUTO_ACKNOWLEDGE)
+      }
+      else if (ackMode == Session.AUTO_ACKNOWLEDGE)
+      {
+         if (trace)
          {
-            if (trace)
-            {
-               log.trace("Don't do anything about AUTO_ACK mode");
-            }
+            log.trace("Don't do anything about AUTO_ACK mode");
          }
-         else if (ackMode == Session.DUPS_OK_ACKNOWLEDGE)
+      }
+      else if (ackMode == Session.DUPS_OK_ACKNOWLEDGE)
+      {
+         if (trace)
          {
-            if (trace)
-            {
-               log.trace("Don't do anything about DUPS_OK_ACK mode");
-            }
+            log.trace("Don't do anything about DUPS_OK_ACK mode");
          }
-         else
-         {             
-            Object txID = state.getCurrentTxId();
-      
-            if (txID != null)
-            {
-
-               if (trace) { log.trace("Marking tx " + txID + " to be rollback only"); }
-               
-               ConnectionState connState = (ConnectionState)state.getParent();
-               
-               connState.getResourceManager().markTxRollbackOnly(txID);
-            }        
-         }
       }
+      else
+      {             
+         Object txID = state.getCurrentTxId();
+   
+         if (txID != null)
+         {
+            if (trace) { log.trace("Marking tx " + txID + " to be rollback only"); }
+            
+            ConnectionState connState = (ConnectionState)state.getParent();
+            
+            connState.getResourceManager().markTxRollbackOnly(txID);
+         }        
+      }
       
       return null;
    }

Modified: branches/Branch_1_4/src/main/org/jboss/jms/tx/ClientTransaction.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/tx/ClientTransaction.java	2011-10-19 04:06:21 UTC (rev 8450)
+++ branches/Branch_1_4/src/main/org/jboss/jms/tx/ClientTransaction.java	2011-10-19 04:38:20 UTC (rev 8451)
@@ -66,7 +66,7 @@
    
    private boolean recovered;
    
-   private boolean rollbackOnly = false;
+   private volatile boolean rollbackOnly = false;
 
    /* Not sent over the wire, this is for differentiating between incompatible versions */
    protected boolean supportsRecovered ;



More information about the jboss-cvs-commits mailing list