[hornetq-commits] JBoss hornetq SVN: r11941 - branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/paging/cursor/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 23 10:40:22 EST 2011


Author: clebert.suconic at jboss.com
Date: 2011-12-23 10:40:21 -0500 (Fri, 23 Dec 2011)
New Revision: 11941

Modified:
   branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
Log:
Backporting JBPAPP-7817

Modified: branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java	2011-12-23 15:39:33 UTC (rev 11940)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java	2011-12-23 15:40:21 UTC (rev 11941)
@@ -181,17 +181,24 @@
       synchronized (this)
       {
          long tx = storage.generateUniqueID();
+         
+         boolean txUsed = false;
          for (Long record : incrementRecords)
          {
+            txUsed = true;
             storage.deleteIncrementRecord(tx, record.longValue());
          }
          
          if (recordID >= 0)
          {
+            txUsed = true;
             storage.deletePageCounter(tx, this.recordID);
          }
          
-         storage.commit(tx);
+         if (txUsed)
+         {
+            storage.commit(tx);
+         }
       }
    }
 



More information about the hornetq-commits mailing list