JTATransactionFactory bug when Transaction cannot be found in JNDI
------------------------------------------------------------------
Key: HHH-3481
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3481
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.0.CR2
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Fix For: 3.2.x, 3.3.x, 3.4
This is the code after linked patch:
protected UserTransaction getUserTransaction() {
log.trace( "Attempting to locate UserTransaction via JNDI [{}]",
getUserTransactionName() );
try {
UserTransaction ut = ( UserTransaction ) getInitialContext().lookup(
getUserTransactionName() );
if ( ut == null ) {
throw new TransactionException( "Naming service lookup for UserTransaction
returned null [" + getUserTransactionName() +"]" );
}
log.trace( "Obtained UserTransaction" );
return ut;
}
catch ( NamingException ne ) {
throw new TransactionException( "Could not find UserTransaction in JNDI [" +
getUserTransaction() + "]", ne );
}
}
Notice that in catch of NamingException we try to build a TransactionException. It is
supposed to embed the JNDI namespace where we attempted to resolve the Transaction; but
rather than getUserTransactionName() we are instead calling back into this same exact
method getUserTransaction().
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira