{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/5605","repository_url":"https://api.github.com/repos/doctrine/doctrine2","labels_url":"https://api.github.com/repos/doctrine/doctrine2/issues/5605/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/issues/5605/comments","events_url":"https://api.github.com/repos/doctrine/doctrine2/issues/5605/events","html_url":"https://github.com/doctrine/doctrine2/issues/5605","id":125964339,"number":5605,"title":"UnitOfWork pre update invoke causes some times fatal errors","user":{"login":"sr-amueller","id":12393150,"avatar_url":"https://avatars1.githubusercontent.com/u/12393150?v=3","gravatar_id":"","url":"https://api.github.com/users/sr-amueller","html_url":"https://github.com/sr-amueller","followers_url":"https://api.github.com/users/sr-amueller/followers","following_url":"https://api.github.com/users/sr-amueller/following{/other_user}","gists_url":"https://api.github.com/users/sr-amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/sr-amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sr-amueller/subscriptions","organizations_url":"https://api.github.com/users/sr-amueller/orgs","repos_url":"https://api.github.com/users/sr-amueller/repos","events_url":"https://api.github.com/users/sr-amueller/events{/privacy}","received_events_url":"https://api.github.com/users/sr-amueller/received_events","type":"User","site_admin":false},"labels":[{"id":296201252,"url":"https://api.github.com/repos/doctrine/doctrine2/labels/Bug","name":"Bug","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":{"login":"guilhermeblanco","id":208883,"avatar_url":"https://avatars2.githubusercontent.com/u/208883?v=3","gravatar_id":"","url":"https://api.github.com/users/guilhermeblanco","html_url":"https://github.com/guilhermeblanco","followers_url":"https://api.github.com/users/guilhermeblanco/followers","following_url":"https://api.github.com/users/guilhermeblanco/following{/other_user}","gists_url":"https://api.github.com/users/guilhermeblanco/gists{/gist_id}","starred_url":"https://api.github.com/users/guilhermeblanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilhermeblanco/subscriptions","organizations_url":"https://api.github.com/users/guilhermeblanco/orgs","repos_url":"https://api.github.com/users/guilhermeblanco/repos","events_url":"https://api.github.com/users/guilhermeblanco/events{/privacy}","received_events_url":"https://api.github.com/users/guilhermeblanco/received_events","type":"User","site_admin":false},"assignees":[{"login":"guilhermeblanco","id":208883,"avatar_url":"https://avatars2.githubusercontent.com/u/208883?v=3","gravatar_id":"","url":"https://api.github.com/users/guilhermeblanco","html_url":"https://github.com/guilhermeblanco","followers_url":"https://api.github.com/users/guilhermeblanco/followers","following_url":"https://api.github.com/users/guilhermeblanco/following{/other_user}","gists_url":"https://api.github.com/users/guilhermeblanco/gists{/gist_id}","starred_url":"https://api.github.com/users/guilhermeblanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guilhermeblanco/subscriptions","organizations_url":"https://api.github.com/users/guilhermeblanco/orgs","repos_url":"https://api.github.com/users/guilhermeblanco/repos","events_url":"https://api.github.com/users/guilhermeblanco/events{/privacy}","received_events_url":"https://api.github.com/users/guilhermeblanco/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/doctrine/doctrine2/milestones/2","html_url":"https://github.com/doctrine/doctrine2/milestone/2","labels_url":"https://api.github.com/repos/doctrine/doctrine2/milestones/2/labels","id":1446273,"number":2,"title":"2.6.0","description":null,"creator":{"login":"beberlei","id":26936,"avatar_url":"https://avatars1.githubusercontent.com/u/26936?v=3","gravatar_id":"","url":"https://api.github.com/users/beberlei","html_url":"https://github.com/beberlei","followers_url":"https://api.github.com/users/beberlei/followers","following_url":"https://api.github.com/users/beberlei/following{/other_user}","gists_url":"https://api.github.com/users/beberlei/gists{/gist_id}","starred_url":"https://api.github.com/users/beberlei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beberlei/subscriptions","organizations_url":"https://api.github.com/users/beberlei/orgs","repos_url":"https://api.github.com/users/beberlei/repos","events_url":"https://api.github.com/users/beberlei/events{/privacy}","received_events_url":"https://api.github.com/users/beberlei/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":249,"state":"open","created_at":"2015-12-06T13:20:23Z","updated_at":"2017-05-16T11:40:18Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-01-11T15:06:47Z","updated_at":"2017-05-18T10:36:38Z","closed_at":"2016-02-16T03:22:06Z","body":"I've the same problem like described in https://github.com/doctrine/doctrine2/issues/3468. Somehow the change set for the entity is gone while calling the commit function. I guess it will work if one changes the following line of code.\n\n``` php\n$this->listenersInvoker->invoke($class, Events::preUpdate, $entity, new PreUpdateEventArgs($entity, $this->em, $this->entityChangeSets[$oid]), $preUpdateInvoke);\n```\n\nTo use the method \"getEntityChangeSet\" to force to get an array. Because it does the same like before in a cleaner manner and one will always get an array back.\n\n``` php\n$this->listenersInvoker->invoke($class, Events::preUpdate, $entity, new PreUpdateEventArgs($entity, $this->em, $this->getEntityChangeSet($entity)), $preUpdateInvoke);\n```\n\n(https://github.com/doctrine/doctrine2/blob/16972935917307c49c6a423edcc1fbb711e0d483/lib/Doctrine/ORM/UnitOfWork.php#L1052)\n\nThis is my first ticket creation for the doctrine2 project, I hope it will help to improve the project.\n"},"comment":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/comments/302367215","html_url":"https://github.com/doctrine/doctrine2/issues/5605#issuecomment-302367215","issue_url":"https://api.github.com/repos/doctrine/doctrine2/issues/5605","id":302367215,"user":{"login":"lcobucci","id":201963,"avatar_url":"https://avatars1.githubusercontent.com/u/201963?v=3","gravatar_id":"","url":"https://api.github.com/users/lcobucci","html_url":"https://github.com/lcobucci","followers_url":"https://api.github.com/users/lcobucci/followers","following_url":"https://api.github.com/users/lcobucci/following{/other_user}","gists_url":"https://api.github.com/users/lcobucci/gists{/gist_id}","starred_url":"https://api.github.com/users/lcobucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcobucci/subscriptions","organizations_url":"https://api.github.com/users/lcobucci/orgs","repos_url":"https://api.github.com/users/lcobucci/repos","events_url":"https://api.github.com/users/lcobucci/events{/privacy}","received_events_url":"https://api.github.com/users/lcobucci/received_events","type":"User","site_admin":false},"created_at":"2017-05-18T10:36:38Z","updated_at":"2017-05-18T10:36:38Z","body":"@apoorva-shah `EntityManager#flush()` will commit the [Unit of Work](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/architecture.html#the-unit-of-work) (UoW) which will then compute the changeset that needs to be applied to the persistence layer. Committing UoW changes in the middle of a commit causes inconsistencies and therefore is invalid.\r\n\r\nYou can read http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html for more information."}}
{"actor":{"display_login":"lcobucci"}}