How to override the System.Transactions default timeout of 10 minutes?
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