0

Is there an ideal EF database command timeout? Is it fine to set it to infinite? The default is 30 seconds, but in case of retrieving and filtering hundred thousands of data(with multiple joins but assuming with optimized queries), it is still possible for a timeout execution.

7
  • Connection timeout is not the same thing as the command timeout. Connection timeout (like the name suggests) is the timeout that occurs if a connection cannot be made to the server in that amount of time. Commented Sep 5, 2018 at 10:32
  • @Igor that added another question in my mind which I think should be in another thread, I think I need to correct my question, thanks Commented Sep 5, 2018 at 10:38
  • 1
    There is no ideal timeout, it just depends on what the command is doing. If you have a offloaded reporting query that you expect will take an extended amount of time to complete you would use a different timeout than you would for normal transactions that should be responsive. Commented Sep 5, 2018 at 10:41
  • ah there's the explanation I`m looking for Commented Sep 5, 2018 at 10:42
  • 1
    I wouldn't. If you have a deadlock at the database level your application will hang indefinitely. Commented Sep 5, 2018 at 10:51

1 Answer 1

-1

You can add Connection Timeout=3000 in you connection string, define in web.config file, that will extend the connection to sql server.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.