@Override public int prepare(Xid xid) throws XAException { List<TransactionContext> contexts = xidContextMap.get(xid); if (contexts == null) { throw new XAException("There is no TransactionContexts for the given xid: " + xid); } for (TransactionContext context : contexts) { Transaction transaction = getTransaction(context); transaction.prepare(); } return XA_OK; }
@Override public int prepare(Xid xid) throws XAException { List<TransactionContext> contexts = xidContextMap.get(xid); if (contexts == null) { throw new XAException("There is no TransactionContexts for the given xid: " + xid); } for (TransactionContext context : contexts) { Transaction transaction = getTransaction(context); transaction.prepare(); } return XA_OK; }
@Override protected Object call() throws Exception { String transactionId = parameters.transactionId; TransactionContext transactionContext = endpoint.getTransactionContext(transactionId); if (transactionContext == null) { throw new TransactionException("No transaction context with given transactionId: " + transactionId); } Transaction transaction = TransactionAccessor.getTransaction(transactionContext); transaction.prepare(); return null; }
@Override protected Object call() throws Exception { String transactionId = parameters.transactionId; TransactionContext transactionContext = endpoint.getTransactionContext(transactionId); if (transactionContext == null) { throw new TransactionException("No transaction context with given transactionId: " + transactionId); } Transaction transaction = TransactionAccessor.getTransaction(transactionContext); transaction.prepare(); 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); }
@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 protected Object call() throws Exception { String transactionId = parameters.transactionId; TransactionContext transactionContext = endpoint.getTransactionContext(transactionId); if (transactionContext == null) { throw new TransactionException("No transaction context with given transactionId: " + transactionId); } Transaction transaction = TransactionAccessor.getTransaction(transactionContext); if (parameters.onePhase) { transaction.prepare(); } transaction.commit(); endpoint.removeTransactionContext(transactionId); return null; }
@Override protected Object call() throws Exception { String transactionId = parameters.transactionId; TransactionContext transactionContext = endpoint.getTransactionContext(transactionId); if (transactionContext == null) { throw new TransactionException("No transaction context with given transactionId: " + transactionId); } Transaction transaction = TransactionAccessor.getTransaction(transactionContext); if (parameters.onePhase) { transaction.prepare(); } transaction.commit(); endpoint.removeTransactionContext(transactionId); return null; }