[DBAL-559] SQL Server Platform error on LOCK MODE in cases of inheritance Created: 17/Jul/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

Status: Resolved
Project: Doctrine DBAL
Component/s: Platforms
Affects Version/s: 2.3.4
Fix Version/s: 2.3.4
Security Level: All

Type: Bug Priority: Critical
Reporter: Fryderyk Benigni Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: sqlserver
Environment:

Windows Server, SQL Server 2008


Issue Links:
Duplicate
duplicates DDC-1624 Locking CTI doesnt work on SQL Server Resolved

 Description   

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.



 Comments   
Comment by Benjamin Eberlei [ 08/Sep/13 ]

This is a known bug, see DDC-1624

Generated at Mon Nov 24 20:30:54 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.