HHH-16672 Locking entities created in the same transaction fails
This commit is contained in:
parent
ca2ae23f78
commit
c6a9278599
|
@ -107,7 +107,12 @@ public class LoaderHelper {
|
|||
entry.forceLocked( object, nextVersion );
|
||||
}
|
||||
else {
|
||||
persister.lock( entry.getId(), entry.getVersion(), object, lockOptions, session );
|
||||
if ( entry.isExistsInDatabase() ) {
|
||||
persister.lock( entry.getId(), entry.getVersion(), object, lockOptions, session );
|
||||
}
|
||||
else {
|
||||
session.forceFlush( entry );
|
||||
}
|
||||
}
|
||||
entry.setLockMode(requestedLockMode);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue