What happens after I get Timeout exception

G

Guogang

Hi,

I get a "Timeout Expired" exception trying to update database on a remote
computer.

I am wondering what is happening at the database, will my command still be
executed at the database server, although my ADO.NET application get the
exception?

I am planning to retry my operation if it is a "Timeout Expired" exception.
But, if the command may or may not be already executed, my retry will have
to use very complicated logic.

Thanks,
Guogang
 
B

bruce barker

it will depend on the transaction was constructed. if it was an implicit
transaction or one that commits before sending any results, it may complete.
the server will only dectect you closed the connection from a timeout when
it wants to return the results, and actually sends the data. of course if it
fails after the timeout it can not tell you as the connection is closed.

-- bruce (sqlwork.com)
 
B

Bernie Yaeger

Hi,

Adjust the command commandtimeout property to as many seconds as you need
for the routine in question. The default is 30 seconds but you can set it
to 0 (it will work as long as it has to) or, say, 600 (for 10 minutes).

HTH,

Bernie Yaeger
 

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