SqlCommand.Timeout doesn't honour setting

G

Guest

Hi

Recently an application of mine which polls a database every 15 seconds for
work to process has started causing Timeout exceptions in the
SqlCommand.ExecuteReader. The reader can generally return any number of
records from 100 to 20,000.

My first problem is that I decided to alter the SqlCommand.Timout property
to something greater than the default 30 seconds. I actually tried to set it
to 300 (5 minutes) and even to 0 infinate timeout. The strange thing is that
the SqlCommand did not honour the new timeout settings and still timeout out
after 30 seconds.

I then called the Query in QueryAnalyzer with Display Execution play and
statistics and even a large query with 15,000 records at the most returned in
a few seconds.

I was using Microsoft Data Access Block as well as trying my own code and
both in a Transaction with Serialized and Read Commited isolation levels.

Does anyone know if .net Framework put any restrictions on the ADO.NET calls
to Sql or other database systems? My reason for asking is I know .net
Framework imposes limits on other functionality withing the framework like
max threads, max IO, max concurrent connections etc etc.

Does anyone else experience SqlCommand not honouring the Timeout property
and lastly does anyone know why SqlCommand times out when its clear that the
query doesn't not take longer than the default timeout period?


Thanks people for any help you can offer.

Andy
 
W

William \(Bill\) Vaughn

Is this the query timeout that's expiring or the Connection timeout?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
G

Guest

Maybe its something else...if you are using a timer....are you disabling the
timer while the database is being accessed? If it take 30 seconds to timeout
a timer may fire again after 15 seconds and muck things up...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top