if (log.isDebugEnabled()) { log.debug("found " + danglingRecords.size() + " dangling record(s) in journal"); }
Iterator<Map.Entry<Uid, JournalRecord>> it = danglingRecords.entrySet().iterator();
while (it.hasNext()) {
Entry<Uid, JournalRecord> entry = it.next();
Uid gtrid = (Uid) entry.getKey();
JournalRecord tlog = (JournalRecord) entry.getValue();
Set<String> uniqueNames = tlog.getUniqueNames();
Set<DanglingTransaction> danglingTransactions = getDanglingTransactionsInRecoveredXids(uniqueNames, tlog.getGtrid());
long txTimestamp = gtrid.extractTimestamp();
if (log.isDebugEnabled()) { log.debug("recovered XID timestamp: " + txTimestamp + " - oldest in-flight TX timestamp: " + oldestTransactionTimestamp); }
if (txTimestamp < oldestTransactionTimestamp) {
if (log.isDebugEnabled()) { log.debug("committing dangling transaction with GTRID " + gtrid); }
commit(danglingTransactions);
if (log.isDebugEnabled()) { log.debug("committed dangling transaction with GTRID " + gtrid); }
committedGtrids.add(gtrid);
Set<String> participatingUniqueNames = filterParticipatingUniqueNamesInRecoveredXids(uniqueNames);
if (participatingUniqueNames.size() > 0) {
if (log.isDebugEnabled()) { log.debug("updating journal's transaction with GTRID " + gtrid + " status to COMMITTED for names [" + buildUniqueNamesString(participatingUniqueNames) + "]"); }
TransactionManagerServices.getJournal().log(Status.STATUS_COMMITTED, tlog.getGtrid(), participatingUniqueNames);
} else {
if (log.isDebugEnabled()) { log.debug("not updating journal's transaction with GTRID " + gtrid + " status to COMMITTED as no resource could be found (incremental recovery will need to clean this)"); }
committedGtrids.remove(gtrid);
}
} else {