BizTalk Troubleshooting: The operation is not valid for the state of the transaction. Transaction Timeout error on WCF-OracleDB Send Port.
Issue
Getting 'System.TimeoutException: Transaction Timeout' errors on WCF-OracleDB send port: The operation is not valid for the state of the transaction.
Recently we faced this issue on one of our BizTalk Send Ports in our production environment.
Steps
Tried out almost every solution available on the internet but no luck. Then we created a ticket with Microsoft against this issue. We worked with Microsoft and finally, we were able to resolve this issue.
Here is the solution that worked in this case (It is actually a combination of two solutions available on MSDN blogs):
BizTalk Service Config File
1. In the BizTalk Service config file, please add the following:
<configuration>
<system.transactions>
<defaultSettings timeout="01:00:00" />
</system.transactions>
</configuration>
Note
If the Oracle Send Port is running on a 32-bit Host Instance, you need to make the addition to BTSNTSvc.exe.config, or BTSNTSvc64.exe.config for a 64-bit Host Instance. These files are available in the BizTalk installation folder.
Machine Config File
2. Apply the following in machine.config:
a. Add the following section in the machine.config file to set the maxTimeout to 1 hour:
<system.transactions>
<machineSettings maxTimeout="01:00:00" />
</system.transactions>
b. Modify the System.Transactions section in machine.config by setting the "allowExeDefinition" attribute to "MachineToApplication" (from MachineOnly).
Note
You need to make the change to the correct version of the machine.config file (32-bit or 64-bit), based on whether the Host Instance that is hosting the Send Port is 32-bit or 64-bit.
References
See Also
Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.