{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3742","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3742/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3742/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3742/events","html_url":"https://github.com/aspnet/EntityFramework/issues/3742","id":116756422,"number":3742,"title":"Is there any way to modify the connection settings (e.g. set ARITHABORT on)","user":{"login":"poke","id":132240,"avatar_url":"https://avatars.githubusercontent.com/u/132240?v=3","gravatar_id":"","url":"https://api.github.com/users/poke","html_url":"https://github.com/poke","followers_url":"https://api.github.com/users/poke/followers","following_url":"https://api.github.com/users/poke/following{/other_user}","gists_url":"https://api.github.com/users/poke/gists{/gist_id}","starred_url":"https://api.github.com/users/poke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poke/subscriptions","organizations_url":"https://api.github.com/users/poke/orgs","repos_url":"https://api.github.com/users/poke/repos","events_url":"https://api.github.com/users/poke/events{/privacy}","received_events_url":"https://api.github.com/users/poke/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/9","html_url":"https://github.com/aspnet/EntityFramework/milestones/Discussions","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/9/labels","id":692755,"number":9,"title":"Discussions","description":"<!--\r\n@huboard:{\"order\":101}\r\n-->","creator":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":64,"state":"open","created_at":"2014-06-16T19:38:35Z","updated_at":"2015-11-19T22:57:35Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-11-13T12:05:48Z","updated_at":"2015-11-19T22:57:35Z","closed_at":"2015-11-19T22:57:35Z","body":"When EF talks to the SQL server, it sets the following settings with the “Audit Login” event (visible in SQL Server Profiler):\r\n\r\n```\r\n-- network protocol: LPC\r\nset quoted_identifier on\r\nset arithabort off\r\nset numeric_roundabort off\r\nset ansi_warnings on\r\nset ansi_padding on\r\nset ansi_nulls on\r\nset concat_null_yields_null on\r\nset cursor_close_on_commit off\r\nset implicit_transactions off\r\nset language us_english\r\nset dateformat mdy\r\nset datefirst 7\r\nset transaction isolation level read committed\r\n```\r\n\r\nIs there any way to modify these settings before executing a query? In my case, I would like to enable `ARITHABORT`, since I am using a (apparently broken) stored procedure and with the setting being turned off, I just get a timeout because it never completes.\r\n\r\nI tried doing a `db.Database.ExecuteSqlCommand(\"SET ARITHABORT ON;\");` before the query but EF resets the connection automatically afterwards restoring its settings."},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/comments/158226953","html_url":"https://github.com/aspnet/EntityFramework/issues/3742#issuecomment-158226953","issue_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3742","id":158226953,"user":{"login":"poke","id":132240,"avatar_url":"https://avatars.githubusercontent.com/u/132240?v=3","gravatar_id":"","url":"https://api.github.com/users/poke","html_url":"https://github.com/poke","followers_url":"https://api.github.com/users/poke/followers","following_url":"https://api.github.com/users/poke/following{/other_user}","gists_url":"https://api.github.com/users/poke/gists{/gist_id}","starred_url":"https://api.github.com/users/poke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poke/subscriptions","organizations_url":"https://api.github.com/users/poke/orgs","repos_url":"https://api.github.com/users/poke/repos","events_url":"https://api.github.com/users/poke/events{/privacy}","received_events_url":"https://api.github.com/users/poke/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T22:57:35Z","updated_at":"2015-11-19T22:57:35Z","body":"I guess that is good enough. Interestingly, the problem I had suddenly disappeared on its own, so I no longer need to modify this. But if this is inherited automatically from the connection, then I guess it isn’t necessary EF’s job :)"}}