this.resumeTransaction(transaction);
try {
// invoke the beforeCompletion
final Xid xid = this.xidTransactionID.getXid();
// Courtesy: com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple
final SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);
if (subordinateTransaction == null) {
throw EjbMessages.MESSAGES.noSubordinateTransactionPresentForXid(xid);
}
// do beforeCompletion()
subordinateTransaction.doBeforeCompletion();
} finally {
// disassociate the tx that was associated (resumed) on this thread.
// This needs to be done explicitly because the SubOrdinationManager isn't responsible
// for clearing the tx context from the thread
this.transactionsRepository.getTransactionManager().suspend();