Jira issue originally created by user xanf:
Let's assume we have an Entity class "ParentClass", which uses a single table inheritance with child classes "ChildOne" and "ChildTwo".
"ParentClass" also have one-to-one unidirectional association with "FooBar" class named "foobar", and a self-referencing association called "parent"
We construct entity of "ChildOne" type, filling "foobar" link with new FooBar object. The same action is made for entity of "ChildTwo" type.
Entity of "ChildOne" type is persisted and flushed.
At this point getCommitOrder builds a commit order. ChildOne <---> FooBar link appears in dependency graph because of "foobar" association.
While processing assocs it reveals "parent" assoc in parent class and builds following links in dependency graph:
ChildOne <---> ChildOne
ChildOne <---> ChildTwo
After that "ChildTwo" entity is persisted and flushed. At this point commit calculator thinks it already have "ChildTwo" in it's storage so no assoc calculation are made for "childTwo" class
If we attemp to delete "ChildTwo" class flush() will fail because of missing link "ChildTwo <-----> Foobar" assoc
Comment created by xanf:
I've opened pull request #47 with my fix to this issue. I'm new to doctrine development so feel free to make any suggestions how to improve it
Comment created by @beberlei:
Increased priority, i should really look at this one soon!
The test with this pull request does not fail even without the applied patch.
sorry my bad, ran this with SQLite (Which has no FKs)
Fixed, simplifed a bit since one part was not necessary and this hits performance quite significantly
Issue was closed with resolution "Fixed"