1

we have asp.net application which when calling the SQL View, is timing out and throwing this exceptionenter image description here

i have set the following values on httpruntime key:

<httpRuntime executionTimeout="60000" maxRequestLength="409643"/>

but it still times out after exactly 30 seconds. the session timeout is set to 20 minutes. any clues what i am doing wrong please?

the view returns all the records within 4 seconds.

Adil
  • 146,340
  • 25
  • 209
  • 204
Baahubali
  • 4,604
  • 6
  • 33
  • 72
  • did you using lot of methods in page load? – Udhay Titus Jul 13 '16 at 05:37
  • no there are only 2 methods inside my page load. – Baahubali Jul 13 '16 at 05:38
  • The exception is from SQL not asp.net and you are setting timeout for asp.net execution – Adil Jul 13 '16 at 05:38
  • @Adil our DBA can't find any issues as he is saying the view is returning results within 4 seconds. he also run update db stats which previously according to him, fixed this timeout issue. also shouldn't asp.net still wait for the given timeout period before throwing the wait operation timed out error? – Baahubali Jul 13 '16 at 05:39
  • What time it takes if you execute that query, if it is some stored procedure then catch the call through SQL server profiler and execute that call in sql server to verify how much time it takes? – Adil Jul 13 '16 at 05:44
  • Also if you are using entity framework or other orm then try to find out time out setting there, http://stackoverflow.com/questions/6232633/entity-framework-timeouts – Adil Jul 13 '16 at 05:46
  • it takes 4 seconds. it's a sql view. – Baahubali Jul 13 '16 at 05:46
  • we are using LLBLGen Pro ORM – Baahubali Jul 13 '16 at 05:46
  • 1
    You need to set _command timeout_ on the database connection, not http runtime or session. It's default 30 seconds. If the execution in SQL Management Studio is fast but not from code, it sounds like a case of parameter sniffing. – Allan S. Hansen Jul 13 '16 at 05:54
  • did u tried with sqlcommand.CommandTimeout=0? – Sachu Jul 13 '16 at 05:54
  • i did not touch the code as it's in our production server but will give it a try in our dev environment . what's parameter sniffing? – Baahubali Jul 13 '16 at 05:56
  • 1
    https://www.brentozar.com/archive/2013/06/the-elephant-and-the-mouse-or-parameter-sniffing-in-sql-server/ – Allan S. Hansen Jul 13 '16 at 05:57

0 Answers0