Jira issue originally created by user pschwisow:
Following the changes for DDC-1690, I encountered a serious bug in how EntityManager::merge(...) functions for entities that use NOTIFY change tracking. It's related to interaction between lazy loading and calls to addPropertyChangedListener().
Steps to reproduce:
Workaround: Mark EntityB::addPropertyChangedListener(...) as 'final', so it doesn't get proxied and lazy loading is not triggered.
Comment created by pschwisow:
Also, the returned proxy from $instanceA->getB() is in the entityStates array but not in the identity map
Comment created by @ocramius:
Looks like this one is related to DDC-1734
I implemented a fix at https://github.com/Ocramius/doctrine2/compare/hotfix;[DDC-2230](http://www.doctrine-project.org/jira/browse/DDC-2230)
Please let me know if that branch works for you: I will open a PR tomorrow.
Comment created by @beberlei:
A related Github Pull-Request [GH-589] was opened
A related Github Pull-Request [GH-589] was closed
Issue was closed with resolution "Fixed"
Comment created by @doctrinebot:
A related Github Pull-Request [GH-589] was closed:
A related Github Pull-Request [GH-1172] was assigned:
A related Github Pull-Request [GH-1172] was closed: