Skip to content

Commit a5bab86

Browse files
committed
remove unnecessary check
this log message is already done by the JDBC-specific TransactionCoordinator
1 parent a4f6329 commit a5bab86

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -644,19 +644,15 @@ protected void pulseTransactionCoordinator() {
644644
@Override
645645
public void joinTransaction() {
646646
checkOpen();
647-
if ( !transactionCoordinator.getTransactionCoordinatorBuilder().isJta() ) {
648-
log.callingJoinTransactionOnNonJtaEntityManager();
647+
try {
648+
// For a non-JTA TransactionCoordinator, this just logs a WARNing
649+
transactionCoordinator.explicitJoin();
649650
}
650-
else {
651-
try {
652-
transactionCoordinator.explicitJoin();
653-
}
654-
catch ( TransactionRequiredForJoinException e ) {
655-
throw new TransactionRequiredException( e.getMessage() );
656-
}
657-
catch ( HibernateException he ) {
658-
throw getExceptionConverter().convert( he );
659-
}
651+
catch ( TransactionRequiredForJoinException e ) {
652+
throw new TransactionRequiredException( e.getMessage() );
653+
}
654+
catch ( HibernateException he ) {
655+
throw getExceptionConverter().convert( he );
660656
}
661657
}
662658

0 commit comments

Comments
 (0)