Commit a5b0f709 authored by Juozas Kaziukenas's avatar Juozas Kaziukenas

Locking fixes

parent bc8a6df8
......@@ -654,6 +654,9 @@ class MsSqlPlatform extends AbstractPlatform
return 'mssql';
}
/**
* @override
*/
protected function initializeDoctrineTypeMappings()
{
$this->doctrineTypeMapping = array(
......@@ -720,4 +723,28 @@ class MsSqlPlatform extends AbstractPlatform
{
return 'ROLLBACK TRANSACTION ' . $savepoint;
}
/**
* @override
*/
public function appendLockHint($fromClause, $lockMode)
{
// @todo coorect
if ($lockMode == \Doctrine\DBAL\LockMode::PESSIMISTIC_READ) {
return $fromClause . ' WITH (tablockx)';
} else if ($lockMode == \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE) {
return $fromClause . ' WITH (tablockx)';
}
else {
return $fromClause;
}
}
/**
* @override
*/
public function getForUpdateSQL()
{
return ' ';
}
}
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