{"action":"created","issue":{"url":"https://api.github.com/repos/nhibernate/nhibernate-core/issues/470","repository_url":"https://api.github.com/repos/nhibernate/nhibernate-core","labels_url":"https://api.github.com/repos/nhibernate/nhibernate-core/issues/470/labels{/name}","comments_url":"https://api.github.com/repos/nhibernate/nhibernate-core/issues/470/comments","events_url":"https://api.github.com/repos/nhibernate/nhibernate-core/issues/470/events","html_url":"https://github.com/nhibernate/nhibernate-core/pull/470","id":146832006,"number":470,"title":"Additional check if child session has already been closed.","user":{"login":"itmagination","id":3994320,"avatar_url":"https://avatars.githubusercontent.com/u/3994320?v=3","gravatar_id":"","url":"https://api.github.com/users/itmagination","html_url":"https://github.com/itmagination","followers_url":"https://api.github.com/users/itmagination/followers","following_url":"https://api.github.com/users/itmagination/following{/other_user}","gists_url":"https://api.github.com/users/itmagination/gists{/gist_id}","starred_url":"https://api.github.com/users/itmagination/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itmagination/subscriptions","organizations_url":"https://api.github.com/users/itmagination/orgs","repos_url":"https://api.github.com/users/itmagination/repos","events_url":"https://api.github.com/users/itmagination/events{/privacy}","received_events_url":"https://api.github.com/users/itmagination/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-04-08T06:47:04Z","updated_at":"2016-12-01T00:19:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nhibernate/nhibernate-core/pulls/470","html_url":"https://github.com/nhibernate/nhibernate-core/pull/470","diff_url":"https://github.com/nhibernate/nhibernate-core/pull/470.diff","patch_url":"https://github.com/nhibernate/nhibernate-core/pull/470.patch"},"body":"This simple fix prevents unnecessary `SessionException(\"Session was already closed\")` throw when both parent session and child session are closed separately (order does not matter). Before invoking close on child session (during parent session close) we should check if child session has not been closed already. Unfortunately to check if session was closed we have to use `SessionImpl` class instead of `ISession` interface, so we changed `SessionImpl`’s `childSessionsByEntityMode` private field type `IDictionary<EntityMode, ISession>` into `IDictionary<EntityMode, SessionImpl>`.\n"},"comment":{"url":"https://api.github.com/repos/nhibernate/nhibernate-core/issues/comments/264039874","html_url":"https://github.com/nhibernate/nhibernate-core/pull/470#issuecomment-264039874","issue_url":"https://api.github.com/repos/nhibernate/nhibernate-core/issues/470","id":264039874,"user":{"login":"hazzik","id":144791,"avatar_url":"https://avatars.githubusercontent.com/u/144791?v=3","gravatar_id":"","url":"https://api.github.com/users/hazzik","html_url":"https://github.com/hazzik","followers_url":"https://api.github.com/users/hazzik/followers","following_url":"https://api.github.com/users/hazzik/following{/other_user}","gists_url":"https://api.github.com/users/hazzik/gists{/gist_id}","starred_url":"https://api.github.com/users/hazzik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazzik/subscriptions","organizations_url":"https://api.github.com/users/hazzik/orgs","repos_url":"https://api.github.com/users/hazzik/repos","events_url":"https://api.github.com/users/hazzik/events{/privacy}","received_events_url":"https://api.github.com/users/hazzik/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T00:19:57Z","updated_at":"2016-12-01T00:19:57Z","body":"Hi @itmagination.\r\n\r\nThere is `ISession.IsOpen` property which implementation is exactly `!IsClosed`, so, this change shall be only one line:\r\n\r\n```\r\nif (pair.Value.IsOpen)\r\n{\r\n     pair.Value.Close();\r\n}\r\n```\r\n\r\nNo other changes are required."}}
{"actor":{"display_login":"hazzik"}}