HHH-10513 - Fix locking WARN message logged when query LockMode is NONE

This commit is contained in:
Andrea Boriero 2016-05-25 22:30:55 +01:00
parent 4a15d23aec
commit 8e3e01340f
1 changed files with 9 additions and 3 deletions

View File

@ -253,7 +253,9 @@ public abstract class Loader {
final LockMode lockMode = determineFollowOnLockMode( parameters.getLockOptions() );
final LockOptions lockOptions = new LockOptions( lockMode );
if ( lockOptions.getLockMode() != LockMode.UPGRADE_SKIPLOCKED ) {
LOG.usingFollowOnLocking();
if ( lockOptions.getLockMode() != LockMode.NONE ) {
LOG.usingFollowOnLocking();
}
lockOptions.setTimeOut( parameters.getLockOptions().getTimeOut() );
lockOptions.setScope( parameters.getLockOptions().getScope() );
afterLoadActions.add(
@ -278,9 +280,13 @@ public abstract class Loader {
final LockMode lockModeToUse = lockOptions.findGreatestLockMode();
if ( lockOptions.hasAliasSpecificLockModes() ) {
LOG.aliasSpecificLockingWithFollowOnLocking( lockModeToUse );
if ( lockOptions.getLockMode() == LockMode.NONE && lockModeToUse == LockMode.NONE ) {
return lockModeToUse;
}
else {
LOG.aliasSpecificLockingWithFollowOnLocking( lockModeToUse );
}
}
return lockModeToUse;
}