Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-559

SQL Server Platform error on LOCK MODE in cases of inheritance

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.3.4
    • Fix Version/s: 2.3.4
    • Component/s: Platforms
    • Security Level: All
    • Labels:
    • Environment:
      Windows Server, SQL Server 2008

      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.

        Issue Links

          Activity

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Fryderyk Benigni
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: