@Override protected LockMode determineFollowOnLockMode(LockOptions lockOptions) { final LockMode lockModeToUse = lockOptions.findGreatestLockMode(); if ( lockOptions.getAliasLockCount() > 1 ) { // > 1 here because criteria always uses alias map for the root lock mode (under 'this_') LOG.aliasSpecificLockingWithFollowOnLocking( lockModeToUse ); } return lockModeToUse; }
protected LockMode determineFollowOnLockMode(LockOptions lockOptions) { final LockMode lockModeToUse = lockOptions.findGreatestLockMode(); if ( lockOptions.hasAliasSpecificLockModes() ) { if ( lockOptions.getLockMode() == LockMode.NONE && lockModeToUse == LockMode.NONE ) { return lockModeToUse; } else { LOG.aliasSpecificLockingWithFollowOnLocking( lockModeToUse ); } } return lockModeToUse; }
@Override public String getForUpdateString(final String aliases, final LockOptions lockOptions) { LockMode lockMode = lockOptions.findGreatestLockMode(); lockOptions.setLockMode( lockMode ); // not sure why this is sometimes empty if ( aliases == null || aliases.isEmpty() ) { return getForUpdateString( lockOptions ); } return getForUpdateString( aliases, lockMode, lockOptions.getTimeOut() ); }
private static boolean definesLocking(LockOptions lockOptions) { final LockMode mostRestrictiveLockMode = lockOptions.findGreatestLockMode(); return mostRestrictiveLockMode.greaterThan( LockMode.READ ); }
@Override public String getForUpdateString(final String aliases, final LockOptions lockOptions) { LockMode lockMode = lockOptions.findGreatestLockMode(); lockOptions.setLockMode( lockMode ); // not sure why this is sometimes empty if ( aliases == null || aliases.isEmpty() ) { return getForUpdateString( lockOptions ); } return getForUpdateString( aliases, lockMode, lockOptions.getTimeOut() ); }
@Override @SuppressWarnings("unchecked") protected List<R> doList() { SqmUtil.verifyIsSelectStatement( getSqmStatement() ); getSession().prepareForQueryExecution( requiresTxn( getLockOptions().findGreatestLockMode() ) ); return resolveSelectQueryPlan().performList( this ); }
@Override protected ScrollableResultsImplementor doScroll(ScrollMode scrollMode) { SqmUtil.verifyIsSelectStatement( getSqmStatement() ); getSession().prepareForQueryExecution( requiresTxn( getLockOptions().findGreatestLockMode() ) ); return resolveSelectQueryPlan().performScroll( scrollMode, this ); }