Skip to content

Commit 64eb4c5

Browse files
scottmarlowgbadner
authored andcommitted
HHH-13433 EntityManager.find() should only check for roll-back-only condition if there is an active JTA transaction, otherwise ORM should throw throw convert( e, lockOptions )
1 parent 2502348 commit 64eb4c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3531,7 +3531,7 @@ public <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode
35313531
throw exceptionConverter.convert( new IllegalArgumentException( e.getMessage(), e ) );
35323532
}
35333533
catch ( JDBCException e ) {
3534-
if ( accessTransaction().getRollbackOnly() ) {
3534+
if ( accessTransaction().isActive() && accessTransaction().getRollbackOnly() ) {
35353535
// assume this is the similar to the WildFly / IronJacamar "feature" described under HHH-12472
35363536
return null;
35373537
}

0 commit comments

Comments
 (0)