You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UPDATE: As a temporary workaround, I switched to the less performant READ_WRITE with the basic filelock implementation, and the problem went away.
I am using Doctrine 2.5 with SLC enabled (memcached) and I have encountered some strange behaviour. When doctrine fetches entities from cache, the @Version column is actually set to NULL instead of whatever value is correctly in the database - looks like the @Version doesn't get updated as far as cache is concerned.
Note that afected entity uses @Orm\Cache(usage="NONSTRICT_READ_WRITE", region="Entity\Contact")
If I restart memcached, correct @Version is loaded (because of the force reload).
This also leads to failure to get optimistic lock (due to incorrectly evaluated version mismatch).
For now, Ill try to prevent this issue from occurring by clearing updated entities from cache, and thus forcing their reload by whoever will request them next.
Thanks for any response/advice!
Here is part of call stack, this time failing on different entity, but for the same reason:
#0 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(483): Doctrine\ORM\OptimisticLockException::lockFailed(Object(DoctrineORMModule\Proxy*CG\CsnTour\Entity\Customer)) #1 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(366): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->updateTable(Object(DoctrineORMModule\ProxyCG\CsnTour\Entity\Customer), 'customer', Array, true) #2 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php(95): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->update(Object(DoctrineORMModule\ProxyCG\CsnTour\Entity\Customer)) #3 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1069): Doctrine\ORM\Cache\Persister\Entity\NonStrictReadWriteCachedEntityPersister->update(Object(DoctrineORMModule\ProxyCG*\CsnTour\Entity\Customer)) #4 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(384): Doctrine\ORM\UnitOfWork->executeUpdates(Object(Doctrine\ORM\Mapping\ClassMetadata)) #5 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL) #6 /var/www/TravelSupport/module/CsnTour/src/CsnTour/Controller/TicketController.php(2014): Doctrine\ORM\EntityManager->flush()
The text was updated successfully, but these errors were encountered:
Jira issue originally created by user dorrogeray:
Greetings everyone,
UPDATE: As a temporary workaround, I switched to the less performant READ_WRITE with the basic filelock implementation, and the problem went away.
I am using Doctrine 2.5 with SLC enabled (memcached) and I have encountered some strange behaviour. When doctrine fetches entities from cache, the @Version column is actually set to NULL instead of whatever value is correctly in the database - looks like the @Version doesn't get updated as far as cache is concerned.
Note that afected entity uses @Orm\Cache(usage="NONSTRICT_READ_WRITE", region="Entity\Contact")
If I restart memcached, correct @Version is loaded (because of the force reload).
This also leads to failure to get optimistic lock (due to incorrectly evaluated version mismatch).
I have no idea, but could this be somehow related to http://www.doctrine-project.org/jira/browse/[DDC-3781](http://www.doctrine-project.org/jira/browse/DDC-3781) ?
For now, Ill try to prevent this issue from occurring by clearing updated entities from cache, and thus forcing their reload by whoever will request them next.
Thanks for any response/advice!
Here is part of call stack, this time failing on different entity, but for the same reason:
#0 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(483): Doctrine\ORM\OptimisticLockException::lockFailed(Object(DoctrineORMModule\Proxy*CG\CsnTour\Entity\Customer))
#1 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(366): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->updateTable(Object(DoctrineORMModule\ProxyCG\CsnTour\Entity\Customer), '
customer
', Array, true)#2 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php(95): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->update(Object(DoctrineORMModule\ProxyCG\CsnTour\Entity\Customer))
#3 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(1069): Doctrine\ORM\Cache\Persister\Entity\NonStrictReadWriteCachedEntityPersister->update(Object(DoctrineORMModule\ProxyCG*\CsnTour\Entity\Customer))
#4 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(384): Doctrine\ORM\UnitOfWork->executeUpdates(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 /var/www/TravelSupport/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL)
#6 /var/www/TravelSupport/module/CsnTour/src/CsnTour/Controller/TicketController.php(2014): Doctrine\ORM\EntityManager->flush()
The text was updated successfully, but these errors were encountered: