mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-960: Locking @Version with MappedSuperClass and Single Table Inheritance results in wrong queries #1200
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Dec 30, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user jackvangalen:
When using a @version field for locking purposes in one of the fields of a MappedSuperClass, things go wrong. Here is my situation:
SpecificUser extends of BaseUser
There is one mapped superclass containing things like createdOn, createdBy and finally the @version field named version.
Now, when I change a record, the following queries are created. The last one is faulty:
Query: UPDATE specificuser SET firstname = ? WHERE id = ?
Query: UPDATE baseuser SET version = version + 1 WHERE id = ? AND version = ?
Query: SELECT version FROM specificuser WHERE id = ? <======= should be: SELECT version FROM baseuser WHERE id = ?
@doctrinebot commented on GitHub (Dec 30, 2010):
Comment created by @beberlei:
You say Single Table Inheritance but specificuser and baseuser are two different tables? How does that work? With single table inheritance both specificuser and baseuser are in the same table.
Can you post your mappings? I am not convinced of this bug yet ;-)
@doctrinebot commented on GitHub (Jan 4, 2011):
Comment created by jackvangalen:
Oops, my mistake. I meant to say 'class table inheritance'. The definitions that I used (slightly modified and translated to English) are below.
@doctrinebot commented on GitHub (Jan 23, 2011):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (Jan 23, 2011):
Issue was closed with resolution "Fixed"