[hornetq-commits] JBoss hornetq SVN: r11953 - trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Jan 3 06:55:16 EST 2012


Author: borges
Date: 2012-01-03 06:55:15 -0500 (Tue, 03 Jan 2012)
New Revision: 11953

Modified:
   trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java
Log:
At ServerSession.doClose(), don't re-start consumer during rollback (as the next thing to do will be to close it)

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java	2012-01-03 11:54:41 UTC (rev 11952)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ServerSessionImpl.java	2012-01-03 11:55:15 UTC (rev 11953)
@@ -76,10 +76,10 @@
 import org.hornetq.utils.json.JSONObject;
 
 /*
- * Session implementation 
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a> 
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a> 
+ * Session implementation
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
  * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
  * @author <a href="mailto:andy.taylor at jboss.org>Andy Taylor</a>
  */
@@ -288,8 +288,7 @@
       if (tx != null && tx.getXid() == null)
       {
          // We only rollback local txs on close, not XA tx branches
-
-         rollback(failed);
+         rollback(failed, true);
       }
 
       Set<ServerConsumer> consumersClone = new HashSet<ServerConsumer>(consumers.values());
@@ -469,6 +468,7 @@
          run();
       }
 
+      @Override
       public String toString()
       {
          return "Temporary Cleaner for queue " + bindingName;
@@ -619,6 +619,12 @@
 
    public void rollback(final boolean considerLastMessageAsDelivered) throws Exception
    {
+      rollback(considerLastMessageAsDelivered, false);
+   }
+
+   private void rollback(final boolean considerLastMessageAsDelivered, final boolean closing) throws Exception
+   {
+
       if (tx == null)
       {
          // Might be null if XA
@@ -626,7 +632,7 @@
          tx = new TransactionImpl(storageManager, timeoutSeconds);
       }
 
-      doRollback(considerLastMessageAsDelivered, tx);
+      doRollback(considerLastMessageAsDelivered, tx, closing);
 
       if (xa)
       {
@@ -855,7 +861,7 @@
             }
             else
             {
-               doRollback(false, theTx);
+               doRollback(false, theTx, false);
             }
          }
       }
@@ -1062,7 +1068,7 @@
 
          return;
       }
-      
+
       consumer.receiveCredits(credits);
    }
 
@@ -1077,7 +1083,7 @@
       {
          log.trace("sendLarge::" + largeMsg);
       }
-      
+
       if (currentLargeMessage != null)
       {
          ServerSessionImpl.log.warn("Replacing incomplete LargeMessage with ID=" + currentLargeMessage.getMessageID());
@@ -1292,7 +1298,7 @@
 
    // Public
    // ----------------------------------------------------------------------------
-   
+
    public void clearLargeMessage()
    {
       currentLargeMessage = null;
@@ -1345,7 +1351,9 @@
       }
    }
 
-   private void doRollback(final boolean lastMessageAsDelived, final Transaction theTx) throws Exception
+   private void
+            doRollback(final boolean lastMessageAsDelived, final Transaction theTx, final boolean closing)
+                                                                                                          throws Exception
    {
       boolean wasStarted = started;
 
@@ -1368,7 +1376,7 @@
 
       theTx.rollback();
 
-      if (wasStarted)
+      if (wasStarted && !closing)
       {
          for (ServerConsumer consumer : consumers.values())
          {



More information about the hornetq-commits mailing list