Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is TransactionScope default Timeout value?

Tags:

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?

like image 844
Uri Abramson Avatar asked Nov 26 '13 18:11

Uri Abramson


People also ask

What is the default timeout for a TransactionScope?

The TransactionScope class uses a default timeout (TransactionManager. DefaultTimeout, which has a default value of 1 minute).

How do I increase TransactionScope timeout?

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 //... }

What is default transaction timeout in C#?

Transaction Scope uses the Machine config setting as the maximum timeout. The default machine timeout is 10 minutes.

What is TransactionScope?

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.


1 Answers

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

like image 195
David Pilkington Avatar answered Sep 18 '22 17:09

David Pilkington