HHH-3481 : minor bug in previous JTATransactionFactory patch

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15252 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2008-10-03 03:03:21 +00:00
parent 647d68cc14
commit e13782cdf8
1 changed files with 5 additions and 4 deletions

View File

@ -156,12 +156,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" );
@ -169,7 +170,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 );
}
}