[hornetq-commits] JBoss hornetq SVN: r10050 - trunk/src/main/org/hornetq/core/paging/impl.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Dec 17 00:17:46 EST 2010
Author: clebert.suconic at jboss.com
Date: 2010-12-17 00:17:45 -0500 (Fri, 17 Dec 2010)
New Revision: 10050
Modified:
trunk/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
Log:
more PageCounter changes
Modified: trunk/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2010-12-17 02:20:26 UTC (rev 10049)
+++ trunk/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2010-12-17 05:17:45 UTC (rev 10050)
@@ -50,6 +50,7 @@
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.Transaction.State;
+import org.hornetq.core.transaction.impl.TransactionImpl;
import org.hornetq.core.transaction.TransactionOperation;
import org.hornetq.core.transaction.TransactionPropertyIndexes;
import org.hornetq.utils.ExecutorFactory;
@@ -876,6 +877,10 @@
lock.readLock().unlock();
}
+ Transaction tx = ctx.getTransaction();
+
+ boolean startedTx = false;
+
lock.writeLock().lock();
try
@@ -884,6 +889,12 @@
{
return false;
}
+
+ if (tx == null)
+ {
+ tx = new TransactionImpl(storageManager);
+ startedTx = true;
+ }
PagedMessage pagedMessage;
@@ -893,8 +904,6 @@
// This will force everything to be persisted
message.bodyChanged();
}
-
- Transaction tx = ctx.getTransaction();
pagedMessage = new PagedMessageImpl(message, routeQueues(tx, listCtx), getTransactionID(tx, listCtx));
@@ -913,6 +922,10 @@
finally
{
lock.writeLock().unlock();
+ if (startedTx)
+ {
+ tx.commit();
+ }
}
}
More information about the hornetq-commits
mailing list