315316317318319320321322323324325326327328329330331332
/** * {@inheritDoc} */ public void commit(Xid xid, boolean onePhase) throws XAException { TransactionContext tx = txGlobal.get(xid); if (tx == null) { throw new XAException(XAException.XAER_NOTA); } try { if (onePhase) { tx.prepare(); } tx.commit(); } finally { txGlobal.remove(xid); } }
333334335336337338339340341342343344345346347
/** * {@inheritDoc} */ public void rollback(Xid xid) throws XAException { TransactionContext tx = txGlobal.get(xid); if (tx == null) { throw new XAException(XAException.XAER_NOTA); } try { tx.rollback(); } finally { txGlobal.remove(xid); } }