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 ...@@ -847,19 +847,21 @@ class SQLServerPlatform extends AbstractPlatform
*/ */
public function appendLockHint($fromClause, $lockMode) public function appendLockHint($fromClause, $lockMode)
{ {
if ($lockMode == LockMode::NONE) { switch ($lockMode) {
return $fromClause . ' WITH (NOLOCK)'; case LockMode::NONE:
} $lockClause = ' WITH (NOLOCK)';
break;
if ($lockMode == LockMode::PESSIMISTIC_READ) { case LockMode::PESSIMISTIC_READ:
return $fromClause . ' WITH (HOLDLOCK, ROWLOCK)'; $lockClause = ' WITH (HOLDLOCK, ROWLOCK)';
} break;
case LockMode::PESSIMISTIC_WRITE:
if ($lockMode == LockMode::PESSIMISTIC_WRITE) { $lockClause = ' WITH (UPDLOCK, ROWLOCK)';
return $fromClause . ' 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