Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All,

I have one scheduled job which is running every day at a scheduled time. It started suddenly throwing the time out error since a week. I changed the application to send a stack trace to me in mail so that I can debug it. Below is the stack trace.

===Stack Trace===
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader()
   at ABC.Program.Run_Report() in XXX.exe :line 8122

===Error Message===
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

===Error Source===
.Net SqlClient Data Provider


I am unable to replicate the issue in UAT server . Can some one please help me in understanding this stack trace so that I can replicate it.
Posted
Updated 1-Oct-15 19:02pm
v2
Comments
ZurdoDev 3-Aug-15 19:41pm    
SQL is timing out.
Prashant Bangaluru 3-Aug-15 19:43pm    
Thanks for your comments. Is it because of query taking long time or any deadlocks?
ZurdoDev 3-Aug-15 19:45pm    
No way to tell from this. Timeouts can results from either long time or deadlocks. I'd suggest looking in your sql logs as well to see if there is more details.
Prashant Bangaluru 3-Aug-15 19:59pm    
Oh yeah.. Thanks for that.. I will verify the logs and update you.
Prashant Bangaluru 3-Aug-15 21:21pm    
Hi Ryan, Looks like these details are not logged neither in SQL log nor in EventViewer.
Do you have any idea how to get that?

1 solution

Certain possibilities,
1. SQL query taking too long
2. Dead lock

First use sql logger.
Find specific one by one query, try to run in sql and check how much time it is taking to execute,
Try to write your query with nolock function, which will resolve your deadlock problem.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900