DBAL-559: SQL Server Platform error on LOCK MODE in cases of inheritance #1768

doctrinebot opened this Issue Jul 17, 2013 · 3 comments

2 participants


Jira issue originally created by user fredcallagan:

Whenever an inheritance is implemented the SQL Server Platform add a Lock Mode at the end of the query while for example on SQL Server 2008 it should add a lock on each joined object.

Current implementation of appendLockHint:

 * {@inheritDoc}
public function appendLockHint($fromClause, $lockMode)
    switch ($lockMode) {
        case LockMode::NONE:
            $lockClause = ' WITH (NOLOCK)';
        case LockMode::PESSIMISTIC_READ:
            $lockClause = ' WITH (HOLDLOCK, ROWLOCK)';
        case LockMode::PESSIMISTIC_WRITE:
            $lockClause = ' WITH (UPDLOCK, ROWLOCK)';
            $lockClause = '';

    return $fromClause . $lockClause;

If the lock mode is added on each object the format of the query would be correct.


Comment created by @beberlei:

This is a known bug, see DDC-1624


Issue was closed with resolution "Duplicate"

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.3.4 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment