HHH-8942 reorganized TransactionCoordinatorImpl#attemptToRegisterJtaSync

to further reduce log level checks
This commit is contained in:
Brett Meyer 2014-02-07 09:57:06 -05:00
parent 687682a620
commit bbe4714196
1 changed files with 6 additions and 6 deletions

View File

@ -214,6 +214,12 @@ public class TransactionCoordinatorImpl implements TransactionCoordinator {
return;
}
JtaPlatform jtaPlatform = getTransactionEnvironment().getJtaPlatform();
if ( jtaPlatform == null ) {
// if no jta platform was registered we wont be able to register a jta synchronization
return;
}
// Has the local transaction (Hibernate facade) taken on the responsibility of driving the transaction inflow?
if ( currentHibernateTransaction.isInitiator() ) {
return;
@ -236,12 +242,6 @@ public class TransactionCoordinatorImpl implements TransactionCoordinator {
// non driving. To that end, the following checks are simply opt outs where we are unable to register the
// synchronization
JtaPlatform jtaPlatform = getTransactionEnvironment().getJtaPlatform();
if ( jtaPlatform == null ) {
// if no jta platform was registered we wont be able to register a jta synchronization
return;
}
// Can we resister a synchronization
if ( !jtaPlatform.canRegisterSynchronization() ) {
if (TRACING) LOG.trace( "registered JTA platform says we cannot currently resister synchronization; skipping" );