mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
HHH-16820 When batching enabled the LockModeType is ignored
This commit is contained in:
parent
bbbf8e969b
commit
bdcc619e29
@ -7,6 +7,7 @@
|
||||
package org.hibernate.loader.ast.internal;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.LockOptions;
|
||||
import org.hibernate.engine.spi.EntityKey;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
@ -89,7 +90,8 @@ private T load(
|
||||
LockOptions lockOptions,
|
||||
Boolean readOnly,
|
||||
SharedSessionContractImplementor session) {
|
||||
if ( hasSingleId ) {
|
||||
// We disable batching if lockMode != NONE
|
||||
if ( hasSingleId || lockOptions.getLockMode() != LockMode.NONE ) {
|
||||
return singleIdLoader.load( id, entityInstance, lockOptions, readOnly, session );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user