Skip to content

Commit a682a7d

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 6dc5f37 commit a682a7d

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
@@ -3347,7 +3347,7 @@ public <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode
33473347
throw getExceptionConverter().convert( new IllegalArgumentException( e.getMessage(), e ) );
33483348
}
33493349
catch ( JDBCException e ) {
3350-
if ( accessTransaction().getRollbackOnly() ) {
3350+
if ( accessTransaction().isActive() && accessTransaction().getRollbackOnly() ) {
33513351
// assume this is the similar to the WildFly / IronJacamar "feature" described under HHH-12472
33523352
return null;
33533353
}

0 commit comments

Comments
 (0)