Is there a transaction time out in ADO.Net which is different from command time out
I have a large number of command executions hapening inside a single transaction. The commands are usually small such as insert/update a single row in a table. I am recieving a timeout error no matter how high I set the co开发者_Go百科mmand time out value in ADO.Net. I am not sure if there is a transaction time out value somewhere that I am missing.
Yes, there is a transaction timeout that is seperate from the command timeout.
This is set when constructing the TransactionScope() class (by either passing a TimeSpan() for the timeout to one of the TransactionScope() constructors that accepts a timeout or by setting the timeout on a TransactionOptions structure and passing that to one of the TransactionScope() constructors that accepts a TransactionOptions).
I think the timeout probably defauls to 0, meaning don't timeout so I expect that this is already being set if you are getting a transaction timeout.
It might help others to assist if you could say a little more about your situation, specifically:
What provider are using? (i.e. what type of connection, e.g. SqlClient)? Are you using explicit transactions or transaction scope? What is the exact error you are gettig?
精彩评论