HHH-3481 : minor bug in previous JTATransactionFactory patch

git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_2@15250 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2008-10-03 03:02:25 +00:00
parent 3766446175
commit 73625c07f8
1 changed files with 5 additions and 4 deletions

View File

@ -155,12 +155,13 @@ public class JTATransactionFactory implements TransactionFactory {
* @return The appropriate {@link UserTransaction} reference. * @return The appropriate {@link UserTransaction} reference.
*/ */
protected UserTransaction getUserTransaction() { 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 { try {
UserTransaction ut = ( UserTransaction ) getInitialContext().lookup( getUserTransactionName() ); UserTransaction ut = ( UserTransaction ) getInitialContext().lookup( utName );
if ( ut == null ) { 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" ); log.trace( "Obtained UserTransaction" );
@ -168,7 +169,7 @@ public class JTATransactionFactory implements TransactionFactory {
return ut; return ut;
} }
catch ( NamingException ne ) { 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 );
} }
} }