final SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);
if (subordinateTransaction == null) {
throw new RuntimeException("No subordinate transaction present with xid " + xid);
}
// do beforeCompletion()
subordinateTransaction.doBeforeCompletion();
} finally {
// disassociate the tx that was asssociated (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();