Author: clebert.suconic(a)jboss.com
Date: 2011-12-23 10:39:33 -0500 (Fri, 23 Dec 2011)
New Revision: 11940
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
Log:
JBPAPP-7817 - removing unreferenced records during deletion of a destination
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java 2011-12-23
14:14:45 UTC (rev 11939)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionCounterImpl.java 2011-12-23
15:39:33 UTC (rev 11940)
@@ -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);
+ }
}
}
Show replies by date