12

What is the default timeout for EF queries? I've tried to find out by checking context.CommandTimeout, but it returns null.

I have also looked in the web config in the connection string for something like Connect Timeout=, but it doesn't seem to be there by default.

1 Answer 1

13

The default timeout for object queries and the SaveChanges operation is defined by the underlying connection provider. Since Entity Framework can be used for many connection providers, mysql, sql server etc. and all have different default timeout's!

So null means default timeout will be used, if you want to know what is the default then it depends on the connection provider you are using!

Sign up to request clarification or add additional context in comments.

4 Comments

Ok, and how would I find out which connection provider that I'm using?
@Johan you don't know which data source are you using with EF? Is it Sql Server? When you make edmx model, it asks you for data source connection right, what you chose at that time?
Yes, its SQL Server 2008 R2.
It should be 30 seconds, but you can increase by setting context.CommandTimeout value if you are experiencing Timeout...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.