What happens after I get Timeout exception

  • Thread starter Thread starter Guogang
  • Start date Start date
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
 
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)
 
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
 
Back
Top