Groups | Blog | Home
all groups > dotnet ado.net > july 2007 >

dotnet ado.net : It's back - the timeout problem


David Thielen
7/27/2007 10:52:04 AM
Hi;

One of our testers is getting this now - and he is not running under a
debugger. The error is:
Exception(s):DataSourceException: executeQuery select=select CategoryName
from Categories Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.

It occurs randomly. And it returns this in under a second so it's unlikely
to be an actual timeout. Also this is hitting Sql Server 2005 Express on the
user's computer so it can't be a network issue.

Any idea what this can be? This code is called when clicking a button in our
program which then runs the exact same code each time. This happens
occasionally and when it does sometimes it happens again the next 2 or 3
times we click the button and then it's gone and everything is working.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Cowboy (Gregory A. Beamer)
7/27/2007 4:49:54 PM
Single threaded connnection (static connection object)
Too short of a timeout setting
Error in the code (cannot tell, as I see none)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
[quoted text, click to view]

David Thielen
7/28/2007 6:28:00 AM
Hi;

Thanks for the ideas. I looked at each:

[quoted text, click to view]
Definitely not this.

[quoted text, click to view]
We do not set the timeout so it's the default. And this happens immediately
while connections that succeed can take a half second to several seconds and
those work.

[quoted text, click to view]
That's my guess too - but we have been over it and over it. And the code is
very straightforward.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




[quoted text, click to view]
Manish Bafna
7/29/2007 7:12:05 AM
Hi,
This error occurs when a database query or stored procedure is not able to
complete execution before a pre-set timeout period expires.I would suggest
try all the suggestions given in below link.It might solve your problem.
http://www.ironspeed.com/Designer/4.3.0/WebHelp/Part_VI/Timeout_expired_The_timeout_period_elapsed_prior_to_completion.htm
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
Manish Bafna
7/29/2007 7:24:02 AM
Hi,
Actually System.Data.IDbCommand.CommandTimeOut = 50; as given in link is not
working.What you can do is inrease commantimeout of command object to higher
value say 120.And also increase executiontimeout in web.config.Let me kmow if
these things have solved your problem.Most importantly you must try to figure
out why the query or stored procedure is running slow ny using SQL
Profiler.Try creating appropriate index or if possible try to return fewer
records.
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
David Thielen
7/29/2007 7:48:00 AM
I don't think it is actually timing out because this happens in under a second.

And it is hitting the Northwind database - the standard Microsoft sample.
It's well designed and small so I don't think its the DB schema.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




[quoted text, click to view]
Manish Bafna
7/29/2007 8:00:01 AM
Hi,
This totally sounds like a deadlock issue. Some timeouts are not really
performance issues but more in the area of scaling or concurrency when a
feature is not being used properly or being used without being aware of the
consequences or being used unknowingly.

Sp_who2 should show a blockage - can be due to a transaction. Can also
consider the with nolock option, but sounds like not necessary for that
action yet - sounds like a leaky transaction.
ref:http://discuss.joelonsoftware.com/default.asp?dotnet.12.505023.22
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
David Thielen
7/31/2007 7:46:03 AM
I think I found it. We had one place where we were not closing a reader and
connection in one place. That seems to have solved it. It was random so we
don't know for sure.

Big thank you to the posters here who said that a timeout could actually be
a lock on resources.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




[quoted text, click to view]
v-wywang NO[at]SPAM online.microsoft.com
7/31/2007 11:46:44 AM
Hello Dave,

We haven't met such issue before. I'm not sure what is the root cause.
Have you resolved the issue so far?
If it still persists, would you please paste some code snippet?
Therefore, we can perform further analyze. thanks.

Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button