Skip to content

Commit f24e470

Browse files
committed
HHH-8341 JtaTransaction logs excessive HHH000426 warning
1 parent 1566586 commit f24e470

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

hibernate-core/src/main/java/org/hibernate/cfg/Environment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@
151151
* Session</tt> (de)serialization.</td>
152152
* </tr>
153153
* <tr>
154-
* <td><tt>hibernate.transaction.manager_lookup_class</tt></td>
155-
* <td>classname of <tt>org.hibernate.transaction.TransactionManagerLookup</tt>
154+
* <td><tt>hibernate.transaction.jta.platform</tt></td>
155+
* <td>classname of <tt>org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform</tt>
156156
* implementor</td>
157157
* </tr>
158158
* <tr>

hibernate-core/src/main/java/org/hibernate/engine/transaction/internal/jta/JtaTransaction.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ protected void doCommit() {
156156
catch ( Exception e ) {
157157
throw new TransactionException( "JTA commit failed: ", e );
158158
}
159-
finally {
160-
isInitiator = false;
161-
}
162159
}
163160

164161
@Override
@@ -169,17 +166,22 @@ protected void afterTransactionCompletion(int status) {
169166
@Override
170167
protected void afterAfterCompletion() {
171168
// this method is a noop if there is a Synchronization!
172-
if ( isDriver ) {
173-
if ( !isInitiator ) {
174-
LOG.setManagerLookupClass();
175-
}
176-
try {
177-
transactionCoordinator().afterTransaction( this, userTransaction.getStatus() );
178-
}
179-
catch (SystemException e) {
180-
throw new TransactionException( "Unable to determine UserTransaction status", e );
169+
try {
170+
if ( isDriver ) {
171+
if ( !isInitiator ) {
172+
LOG.setManagerLookupClass();
173+
}
174+
try {
175+
transactionCoordinator().afterTransaction( this, userTransaction.getStatus() );
176+
}
177+
catch (SystemException e) {
178+
throw new TransactionException( "Unable to determine UserTransaction status", e );
179+
}
181180
}
182181
}
182+
finally {
183+
isInitiator = false;
184+
}
183185
}
184186

185187
@Override

hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ void resolvedSqlTypeDescriptorForDifferentSqlCode(String name,
15011501
void unableToCloseSessionButSwallowingError(HibernateException e);
15021502

15031503
@LogMessage(level = WARN)
1504-
@Message(value = "You should set hibernate.transaction.manager_lookup_class if cache is enabled", id = 426)
1504+
@Message(value = "You should set hibernate.transaction.jta.platform if cache is enabled", id = 426)
15051505
void setManagerLookupClass();
15061506

15071507
// @LogMessage(level = WARN)

hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractEntityManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ public void markForRollbackOnly() {
15361536
TransactionManager transactionManager = sfi().getServiceRegistry().getService( JtaPlatform.class ).retrieveTransactionManager();
15371537
if ( transactionManager == null ) {
15381538
throw new PersistenceException(
1539-
"Using a JTA persistence context wo setting hibernate.transaction.manager_lookup_class"
1539+
"Using a JTA persistence context wo setting hibernate.transaction.jta.platform"
15401540
);
15411541
}
15421542
try {

0 commit comments

Comments
 (0)