}
// Saving the prepared transactions.
Iterator xids = activeCtx.getTxIds();
Xid xid;
XACnxPrepare recoveredPrepare;
XACnxPrepare prepare;
while (xids.hasNext()) {
if (recoveredTransactions == null)
recoveredTransactions = new Hashtable();
xid = (Xid) xids.next();
recoveredPrepare = (XACnxPrepare) recoveredTransactions.get(xid);
prepare = activeCtx.getTxPrepare(xid);
if (recoveredPrepare == null)
recoveredTransactions.put(xid, prepare);
else {
recoveredPrepare.getSendings().addAll(prepare.getSendings());
recoveredPrepare.getAcks().addAll(prepare.getAcks());
}
}
// Finally, deleting the context:
contexts.remove(new Integer(key));