private void pageMessages(final Transaction tx) throws Exception
{
if (!messagesToPage.isEmpty())
{
PageTransactionInfo pageTransaction = (PageTransactionInfo)tx.getProperty(TransactionPropertyIndexes.PAGE_TRANSACTION);
if (pageTransaction == null)
{
pageTransaction = new PageTransactionInfoImpl(tx.getID());
tx.putProperty(TransactionPropertyIndexes.PAGE_TRANSACTION, pageTransaction);
// To avoid a race condition where depage happens before the transaction is completed, we need to inform
// the pager about this transaction is being processed
pagingManager.addTransaction(pageTransaction);
}
boolean pagingPersistent = false;
Set<PagingStore> pagingStoresToSync = new HashSet<PagingStore>();
for (ServerMessage message : messagesToPage)
{
if (message.page(tx.getID()))
{
if (message.isDurable())
{
// We only create pageTransactions if using persistent messages
pageTransaction.increment();
pagingPersistent = true;
pagingStoresToSync.add(message.getPagingStore());
}
}
else