{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/6118","repository_url":"https://api.github.com/repos/doctrine/doctrine2","labels_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6118/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6118/comments","events_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6118/events","html_url":"https://github.com/doctrine/doctrine2/issues/6118","id":187486478,"number":6118,"title":"Drop support for `EntityManager#flush($something)`","user":{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"labels":[{"id":408001692,"url":"https://api.github.com/repos/doctrine/doctrine2/labels/BC%20Break","name":"BC Break","color":"b60205","default":false},{"id":296201351,"url":"https://api.github.com/repos/doctrine/doctrine2/labels/Improvement","name":"Improvement","color":"006b75","default":false}],"state":"open","locked":false,"assignee":{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"assignees":[{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/doctrine/doctrine2/milestones/1","html_url":"https://github.com/doctrine/doctrine2/milestones/3.0","labels_url":"https://api.github.com/repos/doctrine/doctrine2/milestones/1/labels","id":1446272,"number":1,"title":"3.0","description":null,"creator":{"login":"beberlei","id":26936,"avatar_url":"https://avatars.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":25,"closed_issues":6,"state":"open","created_at":"2015-12-06T13:20:21Z","updated_at":"2016-11-05T09:23:41Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-11-05T09:23:41Z","updated_at":"2016-11-06T10:26:10Z","closed_at":null,"body":"`EntityManager#flush($something)` is a problematic operation, since it leads to consumers potentially storing incomplete in-memory graphs into the DB.\r\n\r\nIn general, `flush($something)` should be used as an optimization, but dealing with it from within the ORM has only led to bugs and massive headaches so far, whereas keeping a smaller `UnitOfWork` is trivial from the consumer perspective.\r\n\r\nTherefore, I suggest dropping this ability completely, while consumers should instead approach batch-processing problems with something like:\r\n\r\n * explicit change tracking policy\r\n * use a `TableDataGateway` approach (#5550)\r\n * use `EntityManager#clear()` more often, especially in combination with a `READ_WRITE` second level cache region\r\n * create new `EntityManager` instances, and keep them small"},"comment":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/comments/258672094","html_url":"https://github.com/doctrine/doctrine2/issues/6118#issuecomment-258672094","issue_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6118","id":258672094,"user":{"login":"Ocramius","id":154256,"avatar_url":"https://avatars.githubusercontent.com/u/154256?v=3","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"created_at":"2016-11-06T10:26:09Z","updated_at":"2016-11-06T10:26:09Z","body":"Very good point, Matjaž!\n\nOn 6 Nov 2016 11:10, \"Matjaž Drolc\" <notifications@github.com> wrote:\n\n> After this change happens we need to make sure that flush() method still\n> checks its argument count and throws an exception if there is an argument\n> given. Ignoring the argument silently will lead in hard to catch bugs in\n> people's codebases.\n>\n> —\n> You are receiving this because you were assigned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/doctrine/doctrine2/issues/6118#issuecomment-258671355>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAJakJHB1IQUKYahmukladdiW5pI54tCks5q7aeFgaJpZM4KqNo8>\n> .\n>\n"}}
{"actor":{"display_login":"Ocramius"}}