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

Closed
doctrinebot opened this Issue Jul 17, 2013 · 3 comments

2 participants

@doctrinebot

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)';
            break;
        case LockMode::PESSIMISTIC_READ:
            $lockClause = ' WITH (HOLDLOCK, ROWLOCK)';
            break;
        case LockMode::PESSIMISTIC_WRITE:
            $lockClause = ' WITH (UPDLOCK, ROWLOCK)';
            break;
        default:
            $lockClause = '';
    }

    return $fromClause . $lockClause;
}

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

@doctrinebot

Comment created by @beberlei:

This is a known bug, see DDC-1624

@doctrinebot

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