diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java
index 3bc5732159..b4dc448e6f 100644
--- a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java
+++ b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java
@@ -151,8 +151,8 @@ import org.jboss.logging.Logger;
* Session (de)serialization.
*
*
- * hibernate.transaction.manager_lookup_class |
- * classname of org.hibernate.transaction.TransactionManagerLookup
+ * | hibernate.transaction.jta.platform |
+ * classname of org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform
* implementor |
*
*
diff --git a/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/jta/JtaTransaction.java b/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/jta/JtaTransaction.java
index e55e79e486..ebfddf42a4 100644
--- a/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/jta/JtaTransaction.java
+++ b/hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/jta/JtaTransaction.java
@@ -156,9 +156,6 @@ public class JtaTransaction extends AbstractTransactionImpl {
catch ( Exception e ) {
throw new TransactionException( "JTA commit failed: ", e );
}
- finally {
- isInitiator = false;
- }
}
@Override
@@ -169,17 +166,22 @@ public class JtaTransaction extends AbstractTransactionImpl {
@Override
protected void afterAfterCompletion() {
// this method is a noop if there is a Synchronization!
- if ( isDriver ) {
- if ( !isInitiator ) {
- LOG.setManagerLookupClass();
- }
- try {
- transactionCoordinator().afterTransaction( this, userTransaction.getStatus() );
- }
- catch (SystemException e) {
- throw new TransactionException( "Unable to determine UserTransaction status", e );
+ try {
+ if ( isDriver ) {
+ if ( !isInitiator ) {
+ LOG.setManagerLookupClass();
+ }
+ try {
+ transactionCoordinator().afterTransaction( this, userTransaction.getStatus() );
+ }
+ catch (SystemException e) {
+ throw new TransactionException( "Unable to determine UserTransaction status", e );
+ }
}
}
+ finally {
+ isInitiator = false;
+ }
}
@Override
diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java
index f3a63649e9..1056b56aa1 100644
--- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java
+++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java
@@ -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)
diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractEntityManagerImpl.java b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractEntityManagerImpl.java
index 91ec23e255..e656ad1712 100755
--- a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractEntityManagerImpl.java
+++ b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractEntityManagerImpl.java
@@ -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 {