diff --git a/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/TransactionCoordinatorImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/TransactionCoordinatorImpl.java index 1fa774b1af..cc64434f97 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/TransactionCoordinatorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/TransactionCoordinatorImpl.java @@ -216,6 +216,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; @@ -233,12 +239,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" );