Welcome to MSDN Blogs Sign in | Join | Help

MADHU@MICROSOFT BLOG

All About Distributed apps

Syndication

News

Madhu Ponduru works at Microsoft. Everything here, though, is his personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.
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.

 

<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

 

 

Published Friday, December 16, 2005 10:05 AM by madhu_ponduru@hotmail.com

Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: How to change System.Transactions timeout? @ Monday, March 10, 2008 2:21 AM

Hello Madhu,

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

Harish

# re: How to change System.Transactions timeout? @ Monday, March 17, 2008 5:45 PM

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

madhu_ponduru@hotmail.com

# re: How to change System.Transactions timeout? @ Thursday, July 10, 2008 7:37 AM

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

10x Alot!

Alex

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement  
Page view tracker