If a BizTalk process is connecting to a database and it takes a very long time (more than about 10 minutes), you might encounter this error:
System.Transactions.TransactionException: The operation is not valid for the state of the transaction. ---> System.TimeoutException: Transaction Timeout
This is a database transaction timeout, which is normally set at .NET framework level (so is wider than just BizTalk). It would normally mean that something is running far too slowly, and the best solution is to remedy the problem at source. However, there are other options if you can’t improve performance of the database operation.
Option 1: Disable transactions on send port
This option is most suitable if the error is an occasional occurrence when you’re trying to process an unusually large amount of data. Assuming the offending error appears on a send port (rather than any custom C# you’ve written), you can temporarily disable transactions on the port. This process is easy, and is very clearly described in this article on Stuart Charles’ blog, so I won’t bother replicating the instructions here.
Option 2: Extend transaction timeout
If you are running into this problem more regularly, and can’t improve the query performance, it’s probably better to extend the transaction timeout than to keep disabling transactions on the port.
First, find machine.config within the install directory of the .NET framework. Remember to locate the file within the correct version of the framework (32-bit or 64-bit), depending on whether the problem connection is running under a 32 or 64-bit Host Instance! The location will normally look something like this:
C:\Windows\Microsoft.NET\Framework <OR Framework64>\<version>\Config
Finally, within machine.config, you can add/edit the following within the “configuration” section, adjusting for your preferred timeout. The below would be 30 minutes.
<system.transactions> <machineSettings maxTimeout="00:30:00" /> </system.transactions>
With any luck, that should extend the problem timeout as necessary to solve the issue.