mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3828: Spl_object_hash conflict on Merge #4691
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 (Jul 15, 2015).
Originally assigned to: @Majkl578 on GitHub.
Jira issue originally created by user moroine:
I have created a PR: https://github.com/doctrine/doctrine2/pull/1461
Hi,
First of all, this is just a proposal and I'm sure there is a better solution for the problem described here. As this is my first hack into doctrine source code I'm not sure consequences that might be cause by my modification (even all unit tests passes).
I have encounter a problem due to spl_object_hash. I have written a functional test in order to reveal my issue.
The problem is when I merge an entity, here
$user, UOW keep data on the original entity identified by it's spl_object_hash. Then if I unset this$userthe spl_object_hash is now available for new object. So I experimented in my case reuse of previous hash which cause amanaged+dirty entityerror.So I see two solutions
I tried to implement the second solution as the first may consume a much more memory.
I don't why the merge operation need to do this, so I encapsulated it to prevent unwanted bug :)
@Majkl578 commented on GitHub (Dec 19, 2017):
Duplicate of #4675,