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.
Asked
Active
Viewed 206 times
0
-
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. – Igor Sep 05 '18 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 – xird Sep 05 '18 at 10:38
-
1There 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. – Igor Sep 05 '18 at 10:41
-
ah there's the explanation I`m looking for – xird Sep 05 '18 at 10:42
-
is it fine to just set timeouts to infinite? – xird Sep 05 '18 at 10:43
-
1I wouldn't. If you have a deadlock at the database level your application will hang indefinitely. – Igor Sep 05 '18 at 10:51
-
thank you very much for these inputs – xird Sep 05 '18 at 10:52
1 Answers
-1
You can add Connection Timeout=3000
in you connection string, define in web.config file, that will extend the connection to sql server.

Arvind Kumawat
- 1
- 1