Optimistic locking fails because Doctrine cannot determine version
问题 I use Doctrine 2 and want to use optimistic locking. It fails with an OptimisticLockException and the error message is The optimistic lock failed, version 1 was expected, but is actually . Please not, that the error message stops after the "actually". It seems Doctrine is not able to determine the version of the entity. My simplified entity code is: <?php declare(encoding='UTF-8'); use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table( name = "person" ) */ class Person extends