diff --git a/src/org/hibernate/transaction/JTATransactionFactory.java b/src/org/hibernate/transaction/JTATransactionFactory.java index b533ed80f9..3a8a726221 100644 --- a/src/org/hibernate/transaction/JTATransactionFactory.java +++ b/src/org/hibernate/transaction/JTATransactionFactory.java @@ -155,12 +155,13 @@ public class JTATransactionFactory implements TransactionFactory { * @return The appropriate {@link UserTransaction} reference. */ protected UserTransaction getUserTransaction() { - log.trace( "Attempting to locate UserTransaction via JNDI [" + getUserTransactionName() + "]" ); + final String utName = getUserTransactionName(); + log.trace( "Attempting to locate UserTransaction via JNDI [" + utName + "]" ); try { - UserTransaction ut = ( UserTransaction ) getInitialContext().lookup( getUserTransactionName() ); + UserTransaction ut = ( UserTransaction ) getInitialContext().lookup( utName ); if ( ut == null ) { - throw new TransactionException( "Naming service lookup for UserTransaction returned null [" + getUserTransactionName() +"]" ); + throw new TransactionException( "Naming service lookup for UserTransaction returned null [" + utName +"]" ); } log.trace( "Obtained UserTransaction" ); @@ -168,7 +169,7 @@ public class JTATransactionFactory implements TransactionFactory { return ut; } catch ( NamingException ne ) { - throw new TransactionException( "Could not find UserTransaction in JNDI [" + getUserTransaction() + "]", ne ); + throw new TransactionException( "Could not find UserTransaction in JNDI [" + utName + "]", ne ); } }