Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to override the System.Transactions default timeout of 10 minutes?

msdtc timeout
2
Frank B Posted

How to override the System.Transactions default timeout of 10 minutes?

0
Frank B

Through painstaking research we found out that by default all the distributed transactions initiated using System.Transactions are set to a default timeout of 10 minutes. It seems you can only override this by making the following changes in the machine.config on the computer initiating the transaction statement.

1. Added the following section in the machine.config file to set the maxTimeout to a time you need.  Below it is set for 30 minutes :

<configuration>
 <system.transactions>
   <machineSettings maxTimeout="00:30:00" />
 </system.transactions>
</configuration>

2. We modified the System.Transactions section in machine.config by setting the allowExeDefinition attribute to “MachineToApplication” (from MachineOnly). After this, we were able to override the machine.config timeout of 10 minutes in the code and that allowed the transaction to complete successfully.

 <sectionGroup name="system.transactions" type="System.Transactions.Configuration.TransactionsSectionGroup, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null">
      <section name="defaultSettings" type="System.Transactions.Configuration.DefaultSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <section name="machineSettings" type="System.Transactions.Configuration.MachineSettingsSection, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" allowDefinition="MachineOnly" allowExeDefinition="MachineToApplication" />
    </sectionGroup>

 

FYI – My location for the machine.config on Windows 2008 was –

\Windows\Microsoft.NET\Framework\[version]\config\machine.config

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123