Friday, September 21, 2012

The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.

We had a WCF-SQL send port that was to insert a large data set into the database, and then execute a stored procedure when done, this can all be sent as one message to sql and it works it out.

The problem is that this took a very long time, we increased time outs but were still getting a time out every time, with the error: 

System.Data.SqlClient.SqlException: The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.

Server stack trace:
   at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)

We looked around and found that the timeout for the msdtc controller was in the machine,config.

%Windows%\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config

Or if you run 64bit.

%Windows%\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config

<system.transactions>
<machineSettings maxTimeout=”01:10:00″ />
</system.transactions>

You may find this already in there, we had 00:30:00 as the timeout, we increased this, and it worked.

Problem solved.

2 comments:

lee woo said...

Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime. See the link below for more info.


#lifetime
www.ufgop.org

Silvia Jacinto said...

Reading your article is such a privilege. It does inspire me, I hope that you can share more positive thoughts. Visit my site too. The link is posted below.

n8fan.net

www.n8fan.net