@Override public Object call() throws Exception { Transaction transaction = getTransaction(); if (onePhase) { transaction.prepare(); } transaction.commit(); endpoint.removeTransactionContext(txnId); return null; }
@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); }