Notify policy listeners are not attached to entities with Notify policy

Details

Description

It seems that it happens because the UnitOfWork::addToIdentityMap() is not the only way to add an entity to the identity map. It is possible to do it directly by assigning array values (pulling my hair why?) . But the code in that method also adds a property changed listener to an entity. As a result that entity is not persisted properly as it does not have a listener. I spent a lot of time trying to figure out why some of my entities were persisted and others no. That happens for entities of same class with parent - children associations.

Probably the notify policy is not very popular otherwise the bug would have been reported long time ago.

So Doctrine 2.2.2 is out but the fix for this serious issue was not included in it. What version then it is supposed to fix? Doctrine seems to be riddled with issues related to the Notify strategy (look here for another related issue: http://www.doctrine-project.org/jira/browse/DDC-1775). It renders that strategy unusable.

Oleg Namaka
added a comment - 16/Apr/12 2:45 AM So Doctrine 2.2.2 is out but the fix for this serious issue was not included in it. What version then it is supposed to fix? Doctrine seems to be riddled with issues related to the Notify strategy (look here for another related issue: http://www.doctrine-project.org/jira/browse/DDC-1775 ). It renders that strategy unusable.