When i create a TransactionScope object as followed:
using (TransactionScope ts = new TransactionScope())
{
// Do stuff...
}
What is the default transaction timeout of the given ts object?
The TransactionScope class uses a default timeout (TransactionManager. DefaultTimeout, which has a default value of 1 minute).
SetValue(machineSettings, false); //Change max allowed timeout machineSettings. MaxTimeout = TimeSpan. MaxValue; using (var t = new TransactionScope(TransactionScopeOption. Required, new TimeSpan(1,0,0))) { //1 hour transaction //... }
Transaction Scope uses the Machine config setting as the maximum timeout. The default machine timeout is 10 minutes.
The TransactionScope class provides a simple way to mark a block of code as participating in a transaction, without requiring you to interact with the transaction itself. A transaction scope can select and manage the ambient transaction automatically.
According to David Browne it is 1 minute
TransactionScope’s default constructor defaults the isolation level to Serializable and the timeout to 1 minute
using new TransactionScope() Considered Harmful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With