Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
Dear all, this is my scenario:

1. on my Ms.Sql Server the timeout is set for 10 minutes (see the link)
https://manage.accuwebhosting.com/kb-images/increase-mssql-remote-query-timeout/connections.png[^]

2. in my code I have this transaction where the timeout is set for 20 minutues

using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new System.TimeSpan(0, 20, 0)))
{
    //bla.. bla... bla...
    ts.Complete();
    return true;
}    


What I have tried:

My question is: between the 2 settings which one will be considered and executed?
The server timeout or code timeout.

Best regards
Posted
Updated 9-Feb-22 22:31pm
v2
Comments
Richard MacCutchan 10-Feb-22 4:46am    
Since the server has no knowledge about what is happening on your system it will still (I would guess) use the timeout of 10 minutes. The Transaction timeout will only affect your program running on your client system.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900