HHH-13076 - Hibernate 'Transaction already active' behaviour with JTA transaction manager

This commit is contained in:
Andrea Boriero 2018-11-09 09:15:07 +00:00
parent 0fa4b50188
commit a15dfe0e05
1 changed files with 7 additions and 1 deletions

View File

@ -72,7 +72,13 @@ public class TransactionImpl implements TransactionImplementor {
// per-JPA
if ( isActive() ) {
throw new IllegalStateException( "Transaction already active" );
if ( jpaCompliance.isJpaTransactionComplianceEnabled()
|| !transactionCoordinator.getTransactionCoordinatorBuilder().isJta() ) {
throw new IllegalStateException( "Transaction already active" );
}
else {
return;
}
}
LOG.debug( "begin" );