Tuesday, February 25, 2014

Troubleshooting BizTalk: 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

I tried out almost every solution available on internet but no luck. So, I created a ticket with Microsoft against this issue. I worked with Microsoft guys and finally we were able to resolve this issue.
Here is the solution that worked for me in this case (It is actually a combination of two solutions available on msdn blogs):

1. BizTalk Service Config file
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 32bit Host Instance, you need to make the addition to BTSNTSvc.exe.config, or BTSNTSvc64.exe.config for a 64bit Host Instance. These files are available in the BizTalk installation folder.

2. Machine Config File
Apply the following in machine.config:
2.1. 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>

2.2. 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 machine.config file (32bit or 64bit), based on whether the Host Instance that is hosting the Send Port is 32bit or 64bit.

References

http://blogs.msdn.com/b/madhuponduru/archive/2005/12/16/how-to-change-system-transactions-timeout.aspx
http://blogs.msdn.com/b/ajit/archive/2008/06/18/override-the-system-transactions-default-timeout-of-10-minutes-in-the-code.aspx

No comments:

Post a Comment