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

          Fryderyk Benigni created issue -
          Fabio B. Silva made changes -
          Field Original Value New Value
          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.
          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:

          {code}
          /**
           * {@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;
          }
          {code}

          If the lock mode is added on each object the format of the query would be correct.
          Benjamin Eberlei made changes -
          Link This issue duplicates DDC-1624 [ DDC-1624 ]
          Benjamin Eberlei made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Benjamin Eberlei made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: