New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DDC-2230: Changes from DDC-1690 trigger a bug in entity merging #2929
Comments
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: 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. |
Issue was closed with resolution "Fixed" |
Comment created by @doctrinebot: A related Github Pull-Request [GH-589] was closed: |
Comment created by @doctrinebot: |
Comment created by @doctrinebot: |
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().
Scenario:
Steps to reproduce:
$instanceA = $em->find('EntityA', $id)
$em->clear()
$instanceA = $em->merge($instanceA)
$instanceA->getB() will return a proxy for B that is marked as initialized by contains no data
Workaround: Mark EntityB::addPropertyChangedListener(...) as 'final', so it doesn't get proxied and lazy loading is not triggered.
The text was updated successfully, but these errors were encountered: