[DDC-2175] Optimistic locking version not refreshed on update for class table inheritance Created: 28/Nov/12 Updated: 24/Dec/12 Resolved: 24/Dec/12
|Project:||Doctrine 2 - ORM|
|Reporter:||Colin Campbell||Assignee:||Benjamin Eberlei|
I am trying to use optimistic locking with class table inheritance. I put the version column in the base table. When I perform change a base entity value, persist, and flush, the version in memory does not update to match the new version in the base table. Consequently, subsequent updates fail with "The optimistic lock on an entity failed."
As far as I can tell, the reason is that the update method in Doctrine/ORM/Persisters/JoinedSubclassPersister.php does not call assignDefaultVersionValue in this case.
This change appears to fix the problem.
The new code then looks like this: