Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Weird response time from a stored procedure

$
0
0

Hi All,

I recently hit a bit of a problem and I wanted to know the thoughts of the community.

I have a C# app which calls a stored procedure on a SQL 2008 database, by default when the proc is called, a timeout limit is set so that once that limit is reached the job will timeout and report a failure etc.

Below is what I have started to notice.

  • When the proc is called from the app it starts, and then never ends. For about 3 minutes the app has a runnable status then it goes into sleeping. But I can see still the connection spid on the instance, and during this time the app is still there thinking that the stored proc is running.
  • I have done a recompile on the proc to force the creation of a new plan, yet the problem wasnt solved.
  • I have added WITH RECOMPILE to the stored procedure so that it doesnt use a cached plan to no avail.
  • I have updated stats on the database, it still runs forever via the application.
  • I run the storedp procedure manually, it completes in 3 mins from SSMS.
  • When I check the compile parameter on the query plan which is in use when its in this stuck state, I can see that the compile value isnt thesame as the one currently running (which runs for an infinite time), I even added with recompile and no difference still.

I'm not sure at this stage whether this is a problem from a SQL side or perhaps something with the application, what suprises me is that it has a sleeping status and the users are still thinking that its running on the DB. What I intend to so is for the connection string to be changed to that of a UAT server, this will allow me to see if the issue can be re-created. I do however wonder if this is a DB issue.

Any thoughts pls.

Thanks in advance.


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>