use of com.sun.messaging.jmq.jmsserver.data.BaseTransaction in project openmq by eclipse-ee4j.
the class BaseTransactionManager method removeFromIncompleteUnstored.
BaseTransaction removeFromIncompleteUnstored(TransactionUID tid) {
BaseTransaction result = incompleteUnstored.remove(tid);
if (Store.getDEBUG()) {
String msg = getPrefix() + " removing " + tid + " from incompleteUnstored. Total = " + incompleteUnstored.size();
logger.log(Logger.DEBUG, msg);
}
return result;
}
use of com.sun.messaging.jmq.jmsserver.data.BaseTransaction in project openmq by eclipse-ee4j.
the class BaseTransactionManager method writePreparedTransactionsToPreparedTxnStoreOnCheckpoint.
// on checkpoint, we need to store any newly logged prepared transactions to the preparedTxnStore
// as the transaction log is about to be reset
void writePreparedTransactionsToPreparedTxnStoreOnCheckpoint() throws BrokerException {
if (Store.getDEBUG()) {
String msg = getPrefix() + " writePreparedTransactionsToPreparedTxnStoreOnCheckpoint" + " num incompleteUnstored=" + incompleteUnstored.size();
logger.log(Logger.DEBUG, msg);
}
ArrayList<TransactionUID> incmps = null;
synchronized (incompleteUnstored) {
incmps = new ArrayList<>(incompleteUnstored.keySet());
}
TransactionUID tid = null;
BaseTransaction baseTxn = null;
Iterator<TransactionUID> iter = incmps.iterator();
while (iter.hasNext()) {
tid = iter.next();
if (!preparedTxnStore.containsTransaction(tid)) {
baseTxn = incompleteUnstored.get(tid);
if (baseTxn == null) {
continue;
}
if (Store.getDEBUG()) {
String msg = getPrefix() + " transaction storing preparedTransaction " + baseTxn;
logger.log(Logger.DEBUG, msg);
}
try {
preparedTxnStore.storeTransaction(baseTxn, true);
addToIncompleteStored(baseTxn);
} catch (IOException ioe) {
throw new BrokerException("failed to store transaction in preparedTxnStore " + baseTxn, ioe);
}
} else {
String msg = getPrefix() + " transaction already exists in preparedTxnStore " + tid + "[" + incompleteUnstored.get(tid) + "]";
logger.log(Logger.INFO, msg);
}
}
incompleteUnstored.clear();
}
Aggregations