Skip to content

Commit

Permalink
DDC-178 DQL Optimistic Lock now requires ALL classes to be versioned,…
Browse files Browse the repository at this point in the history
… otherwise throws exception
  • Loading branch information
beberlei committed May 15, 2010
1 parent 1031249 commit ad402c6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/Doctrine/ORM/Query/SqlWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,11 @@ public function walkSelectStatement(AST\SelectStatement $AST)
} else if ($lockMode == \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE) {
$sql .= " " . $this->_platform->getWriteLockSQL();
} else if ($lockMode == \Doctrine\DBAL\LockMode::OPTIMISTIC) {
$versionedClassFound = false;
foreach ($this->_selectedClasses AS $class) {
if ($class->isVersioned) {
$versionedClassFound = true;
if (!$class->isVersioned) {
throw \Doctrine\ORM\OptimisticLockException::lockFailed();
}
}

if (!$versionedClassFound) {
throw \Doctrine\ORM\OptimisticLockException::lockFailed();
}
}
}

Expand Down

0 comments on commit ad402c6

Please sign in to comment.