@Override public void forget(Xid xid) throws XAException { List<TransactionContext> contexts = xidContextMap.remove(xid); if (contexts == null) { throw new XAException("No context with the given xid: " + xid); } clearRemoteTransactions(xid); }
@Override public void forget(Xid xid) throws XAException { List<TransactionContext> contexts = xidContextMap.remove(xid); if (contexts == null) { throw new XAException("No context with the given xid: " + xid); } clearRemoteTransactions(xid); }
@Override public void rollback(Xid xid) throws XAException { List<TransactionContext> contexts = xidContextMap.remove(xid); if (contexts == null) { finalizeTransactionRemotely(xid, false); return; } for (TransactionContext context : contexts) { getTransaction(context).rollback(); } clearRemoteTransactions(xid); }
@Override public void rollback(Xid xid) throws XAException { List<TransactionContext> contexts = xidContextMap.remove(xid); if (contexts == null) { finalizeTransactionRemotely(xid, false); return; } for (TransactionContext context : contexts) { getTransaction(context).rollback(); } clearRemoteTransactions(xid); }
@Override public void commit(Xid xid, boolean onePhase) throws XAException { List<TransactionContext> contexts = xidContextMap.remove(xid); if (contexts == null && onePhase) { throw new XAException("There is no TransactionContexts for the given xid: " + xid); } if (contexts == null) { finalizeTransactionRemotely(xid, true); return; } for (TransactionContext context : contexts) { Transaction transaction = getTransaction(context); if (onePhase) { transaction.prepare(); } transaction.commit(); } clearRemoteTransactions(xid); }
@Override public void commit(Xid xid, boolean onePhase) throws XAException { List<TransactionContext> contexts = xidContextMap.remove(xid); if (contexts == null && onePhase) { throw new XAException("There is no TransactionContexts for the given xid: " + xid); } if (contexts == null) { finalizeTransactionRemotely(xid, true); return; } for (TransactionContext context : contexts) { Transaction transaction = getTransaction(context); if (onePhase) { transaction.prepare(); } transaction.commit(); } clearRemoteTransactions(xid); }