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:
parent
647d68cc14
commit
e13782cdf8
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue