mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2230: Changes from DDC-1690 trigger a bug in entity merging #2807
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 (Jan 9, 2013).
Originally assigned to: @Ocramius on GitHub.
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.
@doctrinebot commented on GitHub (Jan 9, 2013):
Comment created by pschwisow:
Also, the returned proxy from $instanceA->getB() is in the entityStates array but not in the identity map
@doctrinebot commented on GitHub (Jan 23, 2013):
Comment created by @ocramius:
Looks like this one is related to DDC-1734
@doctrinebot commented on GitHub (Feb 23, 2013):
Comment created by @ocramius:
I implemented a fix at https://github.com/Ocramius/doctrine2/compare/hotfix;DDC-2230
Please let me know if that branch works for you: I will open a PR tomorrow.
@doctrinebot commented on GitHub (Feb 23, 2013):
Comment created by @beberlei:
A related Github Pull-Request [GH-589] was opened
https://github.com/doctrine/doctrine2/pull/589
@doctrinebot commented on GitHub (Feb 26, 2013):
Comment created by @beberlei:
A related Github Pull-Request [GH-589] was closed
https://github.com/doctrine/doctrine2/pull/589
@doctrinebot commented on GitHub (Feb 26, 2013):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Apr 29, 2014):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-589] was closed:
https://github.com/doctrine/dbal/pull/589
@doctrinebot commented on GitHub (Nov 12, 2014):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1172] was assigned:
https://github.com/doctrine/doctrine2/pull/1172
@doctrinebot commented on GitHub (Jan 16, 2015):
Comment created by @doctrinebot:
A related Github Pull-Request [GH-1172] was closed:
https://github.com/doctrine/doctrine2/pull/1172