How Can I Find What's Causing My Transaction to Get Promoted?

Posted by Damian Powell on Stack Overflow See other posts from Stack Overflow or by Damian Powell
Published on 2010-04-22T11:26:21Z Indexed on 2010/04/23 4:33 UTC
Read the original article Hit count: 237

I have web site which serves web services (a mixture of .asmx and WCF) which is mostly using LINQ to SQL and System.Transactions. Occaisionally we see the transaction get promoted to a distributed transaction which causes problems because our web servers are isolated from our databases in such a way that it is not possible for us to use MSDTC.

I have configured tracing for System.Transactions by adding the following to my web.config:

<system.diagnostics>
  <sources>
    <source name="System.Transactions" switchValue="Information">
      <listeners>
        <add
          name="tx"
          type="System.Diagnostics.XmlWriterTraceListener"
          initializeData="tx.log"
          />
      </listeners>
    </source>
  </sources>
</system.diagnostics>

It's very interesting and shows me when the transaction is promoted, but I find that it doesn't really help be discover why.

Is there an equivalent tracing mechanism for ADO.NET that will show me when connections are created, including the variables that affect pooling (user, cnn string, transaction scope)?

© Stack Overflow or respective owner

Related posts about ADO.NET

Related posts about transactions