In testsuite, XaTransactionImpl does not handle exceptions thrown from Synchronization.beforeCompletion. The resources (and synchronizations) are not notified properly and the connection is not closed, which causes failures later in the testsuite.