From aad23dc8041876ca7149b7cb24b3a20dfd795820 Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Fri, 7 Feb 2014 09:57:06 -0500 Subject: [PATCH] HHH-8942 reorganized TransactionCoordinatorImpl#attemptToRegisterJtaSync to further reduce log level checks --- .../internal/TransactionCoordinatorImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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" );