Timeout issue with WCF-SAP BizTalk Adapter

Recently when I was working with WCF-SAP Adapter I got the below error

System.Transactions.TransactionException: The operation is not valid for the state of the transaction. —>
System.TimeoutException: Transaction Timeout
— End of inner exception stack trace —
System.Transactions.TransactionState.EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
System.Transactions.Transaction.EnlistVolatile(IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
Microsoft.BizTalk.Adapter.Wcf.Runtime.TransmitTxnBatch..ctor(IBTTransportProxy transportProxy, ControlledTermination control, Transaction transaction)
Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkDeleteTxn.Execute(BizTalkExecutionContext executionContext)

And this error was intermittent, this was occurring only for large sized IDOCS. When I checked SAP system I found that the operation at SAP end took longer time than expected. An another interesting fact was that I received the error in biztalk after the SAP got processed the idoc.

After some research I found that the connection is broken if the operation takes more time than that specified in the SendTimeout of the WCF-SAP send port properties.

After increasing the SendTimeout property it was still not reflecting.
After some research I found that according to the link http://blogs.msdn.com/b/adapters/archive/2008/01/28/timeoutexception-s-timeout-related-argumentoutofrangeexception-s-thrown-from-the-sap-adapter.aspx that some of the Timeout property doesn’t get reflected.

So I added below entries in framework64 .net 4.0  machine.config file(C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config) which will change the timeout setting for entire System.Transactions Namespace.

  <machineSettings maxTimeout=”00:59:00″ />

 After making this Changes my BizTalk Application which was failing, worked as expected.

Happy Biztalking!!

Written by
Shashidharan Krishnan

Reviewed by
Jainath V R 

Microsoft India GTSC

Comments (2)

  1. IW says:

    Very helpful tip…

  2. Jay Sprenkle says:

    On our biztalk 2010 installation this change causes all kinds of failures because it's an invalid configuration option. Is this change only applicable to a specific version of windows/.net?