Hi Experts,
I have a windows service running every minute and has many database operations to perform.
It runs perfectly for many days, sometimes it suddenly stops and throws this exception. Later when we start to debug it, the exceptions goes off, but if we don't debug, the exception continues to come. We are tired of this totally random scenario. Please assist us with this.
We are using sqlhelper.cs for database interaction.
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
Best Regards,
Wajid Ahmed Ansari.
Loading
Sam HobbsPosted Feb 4, 2011, 6:50 PM
I am not familiar with SQL Server enough to help you with the following, but perhaps you can add code to determine if the dataabase is available and if it is then lock it so other maintenance will wait. I am sorry that I can't help with that though.
You could add code to your exception processing so that the service can wait a while and then try again.
Suthish NairPosted Feb 4, 2011, 2:29 PM
Suthish NairPosted Feb 3, 2011, 12:48 PM
check your timeout value and try increasing.
wajid ansariPosted Feb 3, 2011, 6:45 AM
The service is calling DB very frequently. Since three hours the service is responding well and no sign of DB overloads. Also it had been on for 20 days without rest and everything was well.
I will post the message if i get this exception again, i already cleared my logs before.
The additional insight into the problem is every method going to DB suffers the same exception. Like simple update statement running within a second now takes more than 30 seconds when this problem comes up.
So i got curious as whats the main issue.
Hope this helps to get hold of problem.
Suthish NairPosted Feb 3, 2011, 5:23 AM
wajid ansariPosted Feb 3, 2011, 4:54 AM
Suthish NairPosted Feb 3, 2011, 4:49 AM
2. SQLCommand Connection Timeout.
Suthish NairPosted Feb 3, 2011, 4:46 AM
You need to increase the value for Connection TimeOut property.Ther are two types of timeout exception that could be raised by SqlClientobjects: SqlConnection and SqlCommand. Browse and check which one needs to update for your problem.