MADHU@MICROSOFT BLOG

All About Distributed apps

How to change System.Transactions timeout?

How to change System.Transactions timeout?

  • Comments 3

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.

 

<configuration>

 <system.transactions>

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

 </system.transactions>

</configuration>

 

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.

 

<configuration>

 <system.transactions>

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

 </system.transactions>

</configuration>

 

REFERENCE:

http://msdn2.microsoft.com/en-us/library/system.transactions.configuration.defaultsettingssection.aspx

http://msdn2.microsoft.com/en-us/library/system.transactions.configuration.machinesettingssection.aspx

Key words: Transactions MSDTC timeout System.transactions

 

 

Leave a Comment
  • Please add 4 and 5 and type the answer here:
  • Post
  • Hello Madhu,

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

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

    http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=388&SiteID=1

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

    10x Alot!

Page 1 of 1 (3 items)