HHH-8341 JtaTransaction logs excessive HHH000426 warning

This commit is contained in:
Brett Meyer 2013-11-25 13:35:25 -05:00
parent 1566586fbf
commit f24e470181
4 changed files with 18 additions and 16 deletions

View File

@ -151,8 +151,8 @@ import org.jboss.logging.Logger;
* Session</tt> (de)serialization.</td>
* </tr>
* <tr>
* <td><tt>hibernate.transaction.manager_lookup_class</tt></td>
* <td>classname of <tt>org.hibernate.transaction.TransactionManagerLookup</tt>
* <td><tt>hibernate.transaction.jta.platform</tt></td>
* <td>classname of <tt>org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform</tt>
* implementor</td>
* </tr>
* <tr>

View File

@ -156,9 +156,6 @@ public class JtaTransaction extends AbstractTransactionImpl {
catch ( Exception e ) {
throw new TransactionException( "JTA commit failed: ", e );
}
finally {
isInitiator = false;
}
}
@Override
@ -169,6 +166,7 @@ public class JtaTransaction extends AbstractTransactionImpl {
@Override
protected void afterAfterCompletion() {
// this method is a noop if there is a Synchronization!
try {
if ( isDriver ) {
if ( !isInitiator ) {
LOG.setManagerLookupClass();
@ -181,6 +179,10 @@ public class JtaTransaction extends AbstractTransactionImpl {
}
}
}
finally {
isInitiator = false;
}
}
@Override
protected void beforeTransactionRollBack() {

View File

@ -1501,7 +1501,7 @@ public interface CoreMessageLogger extends BasicLogger {
void unableToCloseSessionButSwallowingError(HibernateException e);
@LogMessage(level = WARN)
@Message(value = "You should set hibernate.transaction.manager_lookup_class if cache is enabled", id = 426)
@Message(value = "You should set hibernate.transaction.jta.platform if cache is enabled", id = 426)
void setManagerLookupClass();
// @LogMessage(level = WARN)

View File

@ -1536,7 +1536,7 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
TransactionManager transactionManager = sfi().getServiceRegistry().getService( JtaPlatform.class ).retrieveTransactionManager();
if ( transactionManager == null ) {
throw new PersistenceException(
"Using a JTA persistence context wo setting hibernate.transaction.manager_lookup_class"
"Using a JTA persistence context wo setting hibernate.transaction.jta.platform"
);
}
try {