{"action":"closed","number":1461,"pull_request":{"url":"https://api.github.com/repos/doctrine/doctrine2/pulls/1461","id":40039301,"html_url":"https://github.com/doctrine/doctrine2/pull/1461","diff_url":"https://github.com/doctrine/doctrine2/pull/1461.diff","patch_url":"https://github.com/doctrine/doctrine2/pull/1461.patch","issue_url":"https://api.github.com/repos/doctrine/doctrine2/issues/1461","number":1461,"state":"closed","locked":false,"title":"Spl_object_hash conflict on Merge","user":{"login":"moroine","id":4658821,"avatar_url":"https://avatars.githubusercontent.com/u/4658821?v=3","gravatar_id":"","url":"https://api.github.com/users/moroine","html_url":"https://github.com/moroine","followers_url":"https://api.github.com/users/moroine/followers","following_url":"https://api.github.com/users/moroine/following{/other_user}","gists_url":"https://api.github.com/users/moroine/gists{/gist_id}","starred_url":"https://api.github.com/users/moroine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moroine/subscriptions","organizations_url":"https://api.github.com/users/moroine/orgs","repos_url":"https://api.github.com/users/moroine/repos","events_url":"https://api.github.com/users/moroine/events{/privacy}","received_events_url":"https://api.github.com/users/moroine/received_events","type":"User","site_admin":false},"body":"Hi, \r\n\r\nFirst 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).\r\n\r\nI have encounter a problem due to spl_object_hash. I have written a functional test in order to reveal my issue.\r\n\r\nThe 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 `$user` the spl_object_hash is now available for new object. So I experimented in my case reuse of previous hash which cause a `managed+dirty entity` error.\r\n\r\nSo I see two solutions\r\n - UOW keep reference to the entity given as even the given variable is unset there is remaining reference in UOW so the spl_hash will not be released.\r\n - Do not store data about the given entity, as merge operation isn't supposed to modified given entity.\r\n\r\nI tried to implement the second solution as the first may consume a much more memory.\r\n\r\nI don't why the merge operation need to do this, so I encapsulated it to prevent unwanted bug :)\r\n","created_at":"2015-07-15T16:02:28Z","updated_at":"2015-11-27T16:46:58Z","closed_at":"2015-11-27T16:46:58Z","merged_at":null,"merge_commit_sha":"86e416162d0702c7283678314dcc280deac65c54","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doctrine/doctrine2/pulls/1461/commits","review_comments_url":"https://api.github.com/repos/doctrine/doctrine2/pulls/1461/comments","review_comment_url":"https://api.github.com/repos/doctrine/doctrine2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/issues/1461/comments","statuses_url":"https://api.github.com/repos/doctrine/doctrine2/statuses/c94691297e63ad7d9f13fe34c2df91a534bb08a2","head":{"label":"AdactiveSAS:2.5","ref":"2.5","sha":"c94691297e63ad7d9f13fe34c2df91a534bb08a2","user":{"login":"AdactiveSAS","id":11718077,"avatar_url":"https://avatars.githubusercontent.com/u/11718077?v=3","gravatar_id":"","url":"https://api.github.com/users/AdactiveSAS","html_url":"https://github.com/AdactiveSAS","followers_url":"https://api.github.com/users/AdactiveSAS/followers","following_url":"https://api.github.com/users/AdactiveSAS/following{/other_user}","gists_url":"https://api.github.com/users/AdactiveSAS/gists{/gist_id}","starred_url":"https://api.github.com/users/AdactiveSAS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdactiveSAS/subscriptions","organizations_url":"https://api.github.com/users/AdactiveSAS/orgs","repos_url":"https://api.github.com/users/AdactiveSAS/repos","events_url":"https://api.github.com/users/AdactiveSAS/events{/privacy}","received_events_url":"https://api.github.com/users/AdactiveSAS/received_events","type":"Organization","site_admin":false},"repo":{"id":39137003,"name":"doctrine2","full_name":"AdactiveSAS/doctrine2","owner":{"login":"AdactiveSAS","id":11718077,"avatar_url":"https://avatars.githubusercontent.com/u/11718077?v=3","gravatar_id":"","url":"https://api.github.com/users/AdactiveSAS","html_url":"https://github.com/AdactiveSAS","followers_url":"https://api.github.com/users/AdactiveSAS/followers","following_url":"https://api.github.com/users/AdactiveSAS/following{/other_user}","gists_url":"https://api.github.com/users/AdactiveSAS/gists{/gist_id}","starred_url":"https://api.github.com/users/AdactiveSAS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdactiveSAS/subscriptions","organizations_url":"https://api.github.com/users/AdactiveSAS/orgs","repos_url":"https://api.github.com/users/AdactiveSAS/repos","events_url":"https://api.github.com/users/AdactiveSAS/events{/privacy}","received_events_url":"https://api.github.com/users/AdactiveSAS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AdactiveSAS/doctrine2","description":"Doctrine 2 Object Relational Mapper (ORM)","fork":true,"url":"https://api.github.com/repos/AdactiveSAS/doctrine2","forks_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/forks","keys_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/teams","hooks_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/hooks","issue_events_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/issues/events{/number}","events_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/events","assignees_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/assignees{/user}","branches_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/branches{/branch}","tags_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/tags","blobs_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/git/refs{/sha}","trees_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/statuses/{sha}","languages_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/languages","stargazers_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/stargazers","contributors_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/contributors","subscribers_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/subscribers","subscription_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/subscription","commits_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/commits{/sha}","git_commits_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/git/commits{/sha}","comments_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/comments{/number}","issue_comment_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/issues/comments{/number}","contents_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/contents/{+path}","compare_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/merges","archive_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/downloads","issues_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/issues{/number}","pulls_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/pulls{/number}","milestones_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/milestones{/number}","notifications_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/labels{/name}","releases_url":"https://api.github.com/repos/AdactiveSAS/doctrine2/releases{/id}","created_at":"2015-07-15T13:00:54Z","updated_at":"2015-07-15T13:00:58Z","pushed_at":"2015-11-27T16:46:18Z","git_url":"git://github.com/AdactiveSAS/doctrine2.git","ssh_url":"git@github.com:AdactiveSAS/doctrine2.git","clone_url":"https://github.com/AdactiveSAS/doctrine2.git","svn_url":"https://github.com/AdactiveSAS/doctrine2","homepage":"http://www.doctrine-project.org","size":27072,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"doctrine:2.5","ref":"2.5","sha":"04254a8e345e0224994c7982b31ec94fb747cf59","user":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"repo":{"id":597887,"name":"doctrine2","full_name":"doctrine/doctrine2","owner":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doctrine/doctrine2","description":"Doctrine 2 Object Relational Mapper (ORM)","fork":false,"url":"https://api.github.com/repos/doctrine/doctrine2","forks_url":"https://api.github.com/repos/doctrine/doctrine2/forks","keys_url":"https://api.github.com/repos/doctrine/doctrine2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doctrine/doctrine2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doctrine/doctrine2/teams","hooks_url":"https://api.github.com/repos/doctrine/doctrine2/hooks","issue_events_url":"https://api.github.com/repos/doctrine/doctrine2/issues/events{/number}","events_url":"https://api.github.com/repos/doctrine/doctrine2/events","assignees_url":"https://api.github.com/repos/doctrine/doctrine2/assignees{/user}","branches_url":"https://api.github.com/repos/doctrine/doctrine2/branches{/branch}","tags_url":"https://api.github.com/repos/doctrine/doctrine2/tags","blobs_url":"https://api.github.com/repos/doctrine/doctrine2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doctrine/doctrine2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doctrine/doctrine2/git/refs{/sha}","trees_url":"https://api.github.com/repos/doctrine/doctrine2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doctrine/doctrine2/statuses/{sha}","languages_url":"https://api.github.com/repos/doctrine/doctrine2/languages","stargazers_url":"https://api.github.com/repos/doctrine/doctrine2/stargazers","contributors_url":"https://api.github.com/repos/doctrine/doctrine2/contributors","subscribers_url":"https://api.github.com/repos/doctrine/doctrine2/subscribers","subscription_url":"https://api.github.com/repos/doctrine/doctrine2/subscription","commits_url":"https://api.github.com/repos/doctrine/doctrine2/commits{/sha}","git_commits_url":"https://api.github.com/repos/doctrine/doctrine2/git/commits{/sha}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/comments{/number}","issue_comment_url":"https://api.github.com/repos/doctrine/doctrine2/issues/comments{/number}","contents_url":"https://api.github.com/repos/doctrine/doctrine2/contents/{+path}","compare_url":"https://api.github.com/repos/doctrine/doctrine2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doctrine/doctrine2/merges","archive_url":"https://api.github.com/repos/doctrine/doctrine2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doctrine/doctrine2/downloads","issues_url":"https://api.github.com/repos/doctrine/doctrine2/issues{/number}","pulls_url":"https://api.github.com/repos/doctrine/doctrine2/pulls{/number}","milestones_url":"https://api.github.com/repos/doctrine/doctrine2/milestones{/number}","notifications_url":"https://api.github.com/repos/doctrine/doctrine2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doctrine/doctrine2/labels{/name}","releases_url":"https://api.github.com/repos/doctrine/doctrine2/releases{/id}","created_at":"2010-04-06T21:42:59Z","updated_at":"2015-11-27T13:53:29Z","pushed_at":"2015-11-27T16:46:19Z","git_url":"git://github.com/doctrine/doctrine2.git","ssh_url":"git@github.com:doctrine/doctrine2.git","clone_url":"https://github.com/doctrine/doctrine2.git","svn_url":"https://github.com/doctrine/doctrine2","homepage":"http://www.doctrine-project.org","size":31050,"stargazers_count":2804,"watchers_count":2804,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1400,"mirror_url":null,"open_issues_count":91,"forks":1400,"open_issues":91,"watchers":2804,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/1461"},"html":{"href":"https://github.com/doctrine/doctrine2/pull/1461"},"issue":{"href":"https://api.github.com/repos/doctrine/doctrine2/issues/1461"},"comments":{"href":"https://api.github.com/repos/doctrine/doctrine2/issues/1461/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/1461/comments"},"review_comment":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doctrine/doctrine2/pulls/1461/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/doctrine2/statuses/c94691297e63ad7d9f13fe34c2df91a534bb08a2"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":4,"review_comments":0,"commits":6,"additions":611,"deletions":236,"changed_files":5}}