How to change System.Transactions timeout?

System.Transactions actually has two timeout values that can be specified in the configuration files.

In app.config, there is a “timeout” setting.  If this setting is not specified, it defaults to 1 minute.  But it can be overridden in code in the constructor for CommittableTransaction or TransactionScope.


In machine.config, there is a “maximum timeout” setting.  If this setting is not specified, it defaults to 10 minutes.  It cannot be overridden in code.  It is designed to be used by the System Administrator to limit transaction timeouts.  If the app.config timeout or the timeout specified in the constructors above exceed the maximum timeout in the machine.config, the timeout is adjusted down to the maximum timeout value.

How to change timeout value?


The default timeout for System.Transactions transactions is 1 minute.  You can set it in either app config, web config, or machine config.  Setting the default timeout looks like the following.




  <defaultSettings timeout="00:00:30" />




For System.Transactions there is also a maximum transaction timeout.  That can be specified only in machine config.  To change that you would specify the maxTimeout property of the machine settings section.




  <machineSettings maxTimeout="00:00:30" />





Key words: Transactions MSDTC timeout System.transactions



Comments (3)

  1. Harish says:

    Hello Madhu,

    Nice info. Can we set time out of transaction time out to unlimited. What are the changes required in machin.config

  2. If you have any question related to MSDTC or system.Transactions,please send your question to DTC forum

  3. Alex says:

    Thank u!!! i’ve been breaking my head on that, didn’t know about the machine config.

    10x Alot!

Skip to main content