int commitCount = 0;
int rollbackCount = 0;
Iterator it = xids.iterator();
while (it.hasNext()) {
BitronixXid xid = (BitronixXid) it.next();
Uid gtrid = xid.getGlobalTransactionIdUid();
TransactionLogRecord tlog = (TransactionLogRecord) danglingRecords.get(gtrid);
if (tlog != null) {
if (log.isDebugEnabled()) log.debug("committing " + xid);
success &= RecoveryHelper.commit(xaResourceHolderState, xid);
updateJournal(xid.getGlobalTransactionIdUid(), uniqueName, Status.STATUS_COMMITTED);
commitCount++;
}
else {
if (log.isDebugEnabled()) log.debug("rolling back " + xid);
success &= RecoveryHelper.rollback(xaResourceHolderState, xid);
updateJournal(xid.getGlobalTransactionIdUid(), uniqueName, Status.STATUS_ROLLEDBACK);
rollbackCount++;
}
}
// if recovery isn't successful we don't mark the resource as failed: heuristics might have happened