Commit c9b1dc1b authored by Steve Müller's avatar Steve Müller

Fix locking hints again

parent f58165cf
......@@ -847,19 +847,21 @@ class SQLServerPlatform extends AbstractPlatform
*/
public function appendLockHint($fromClause, $lockMode)
{
if ($lockMode == LockMode::NONE) {
return $fromClause . ' WITH (NOLOCK)';
}
if ($lockMode == LockMode::PESSIMISTIC_READ) {
return $fromClause . ' WITH (HOLDLOCK, ROWLOCK)';
}
if ($lockMode == LockMode::PESSIMISTIC_WRITE) {
return $fromClause . ' WITH (UPDLOCK, ROWLOCK)';
switch ($lockMode) {
case LockMode::NONE:
$lockClause = ' WITH (NOLOCK)';
break;
case LockMode::PESSIMISTIC_READ:
$lockClause = ' WITH (HOLDLOCK, ROWLOCK)';
break;
case LockMode::PESSIMISTIC_WRITE:
$lockClause = ' WITH (UPDLOCK, ROWLOCK)';
break;
default:
$lockClause = '';
}
return $fromClause;
return $fromClause . $lockClause;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment