{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/112","labels_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/112/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/112/events","html_url":"https://github.com/Particular/NServiceBus.NHibernate/issues/112","id":97533103,"number":112,"title":"Make usage of NHibernate compatible with `SET NOCOUNT ON` DB-wide setting","user":{"login":"SzymonPobiega","id":163318,"avatar_url":"https://avatars.githubusercontent.com/u/163318?v=3","gravatar_id":"","url":"https://api.github.com/users/SzymonPobiega","html_url":"https://github.com/SzymonPobiega","followers_url":"https://api.github.com/users/SzymonPobiega/followers","following_url":"https://api.github.com/users/SzymonPobiega/following{/other_user}","gists_url":"https://api.github.com/users/SzymonPobiega/gists{/gist_id}","starred_url":"https://api.github.com/users/SzymonPobiega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SzymonPobiega/subscriptions","organizations_url":"https://api.github.com/users/SzymonPobiega/orgs","repos_url":"https://api.github.com/users/SzymonPobiega/repos","events_url":"https://api.github.com/users/SzymonPobiega/events{/privacy}","received_events_url":"https://api.github.com/users/SzymonPobiega/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-07-27T19:09:04Z","updated_at":"2015-07-28T17:24:18Z","closed_at":null,"body":"### Symptoms\r\n\r\nWhen `NOCOUNT` is set to `ON` our NH persistence does not work. Even if it can be hacked to get working via adding the proper `SET NOCOUNT OFF` setting as part of session initialization, there are places e.g. `TryRemoveTimeoutEntity` where it cannot be done. \r\n\r\n### Who's affected\r\n\r\nUsers that have `NOCOUNT ON` on DB level\r\n\r\n### Potential solution\r\n\r\nExtend the API that allows to customize how sessions are created so that users can customize each and every session used, not only the one used for saga and outbox."},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/comments/125684485","html_url":"https://github.com/Particular/NServiceBus.NHibernate/issues/112#issuecomment-125684485","issue_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/112","id":125684485,"user":{"login":"a-belevich","id":5309757,"avatar_url":"https://avatars.githubusercontent.com/u/5309757?v=3","gravatar_id":"","url":"https://api.github.com/users/a-belevich","html_url":"https://github.com/a-belevich","followers_url":"https://api.github.com/users/a-belevich/followers","following_url":"https://api.github.com/users/a-belevich/following{/other_user}","gists_url":"https://api.github.com/users/a-belevich/gists{/gist_id}","starred_url":"https://api.github.com/users/a-belevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-belevich/subscriptions","organizations_url":"https://api.github.com/users/a-belevich/orgs","repos_url":"https://api.github.com/users/a-belevich/repos","events_url":"https://api.github.com/users/a-belevich/events{/privacy}","received_events_url":"https://api.github.com/users/a-belevich/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T17:24:18Z","updated_at":"2015-07-28T17:24:18Z","body":"It looks like \r\n\r\n    bool TryGetConnection(out IDbConnection connection)\r\n    {\r\n        DbConnectionProvider.TryGetConnection(out connection, ConnectionString);\r\n    }\r\n\r\nprevents timeout persister from using the fixed connection provider. Replacing this function with \r\n\r\n        connection = SessionFactory.GetConnection();\r\n        return true;\r\n\r\nsolves the problem."}}