TransactionContext transactionContext = endpoint.getTransactionContext(txnId);
if (prepareAndCommit) {
transactionContext.commitTransaction();
} else {
Transaction transaction = TransactionAccessor.getTransaction(transactionContext);
transaction.commit();
}
endpoint.removeTransactionContext(txnId);
return null;
}