throw cause;
}
}
private void commitResources(List rms) throws SystemException {
SystemException cause = null;
synchronized (this) {
status = Status.STATUS_COMMITTING;
}
for (Iterator i = rms.iterator(); i.hasNext();) {
TransactionBranch manager = (TransactionBranch) i.next();
try {
manager.getCommitter().commit(manager.getBranchId(), false);
} catch (XAException e) {
log.error("Unexpected exception committing" + manager.getCommitter() + "; continuing to commit other RMs", e);
if (cause == null) {
cause = new SystemException(e.errorCode);
}
continue;
}
}
//if all resources were read only, we didn't write a prepare record.
if (!rms.isEmpty()) {
try {
txnLog.commit(xid, logMark);
} catch (LogException e) {
log.error("Unexpected exception logging commit completion for xid " + xid, e);
throw (SystemException)new SystemException("Unexpected error logging commit completion for xid " + xid).initCause(e);
}
}
synchronized (this) {
status = Status.STATUS_COMMITTED;
}