mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 14:30:16 +00:00
Fix SessionImpl#buildLockOptions causing NPE
This commit is contained in:
parent
9ba18b8c5d
commit
3e3db6d352
@ -2919,12 +2919,15 @@ public void refresh(Object entity, LockModeType lockModeType, Map<String, Object
|
||||
}
|
||||
|
||||
private LockOptions buildLockOptions(LockModeType lockModeType, Map<String, Object> properties) {
|
||||
final LockOptions output = this.lockOptions.makeCopy();
|
||||
output.setLockMode( LockModeTypeHelper.getLockMode( lockModeType ) );
|
||||
if ( properties != null ) {
|
||||
LockOptionsHelper.applyPropertiesToLockOptions( properties, () -> output );
|
||||
LockOptions lockOptions = new LockOptions();
|
||||
if ( this.lockOptions != null ) { //otherwise the default LockOptions constructor is the same as DEFAULT_LOCK_OPTIONS
|
||||
LockOptions.copy( this.lockOptions, lockOptions );
|
||||
}
|
||||
return output;
|
||||
lockOptions.setLockMode( LockModeTypeHelper.getLockMode( lockModeType ) );
|
||||
if ( properties != null ) {
|
||||
LockOptionsHelper.applyPropertiesToLockOptions( properties, () -> lockOptions );
|
||||
}
|
||||
return lockOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user