How do I determine problem with DTC in distributed application?

Joseph Hornsey
Joseph Hornsey used Ask the Experts™
on
I have a C# application that issues the following SQL Statement:

        internal void ClearCode(long requestId)
        {
            string sql = "UPDATE MyRequest SET TempCode = NULL, AccountNumber = '' WHERE RequestId = {0}";
            using (MyDataContext db = new MyDataContext(connect))
            {
                db.ExecuteCommand(sql, new object[] { requestId });
            }
        }

Which is failing with:

System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException (0x8004D01B): The Transaction Manager is not available. (Exception from HRESULT: 0x8004D01B)

My application runs on SERVERA and my database is clustered on SERVERB.
My connect string points to SERVERB and all other SQL statements seem to work fine.
We have DTC installed in the clustered environment on SERVERC.
MyDataContext is the class generated by the SQLMetal and represents the DB on SERVERB.

When I look at Component Services on my DBServer, it reports that DTC is alive and well.  When I look at the Services on my DBServer, it shows 2 instances of DTC Running (with Guids in the name), which I understand is normal as well.
When I look at Services in my AppServer (SERVERA), the DTC task is not running and when I try to start it it fails with:

Log Name:      Application
Source:        Microsoft-Windows-MSDTC
Date:          1/27/2010 3:04:55 PM
Event ID:      4163
Task Category: LOG
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      servera.mydomain.com
Description:
MS DTC log file not found. After ensuring that all Resource Managers coordinated by MS DTC have no indoubt transactions, please run msdtc -resetlog to create the log file.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-MSDTC" Guid="{719BE4ED-E9BC-4DD8-A7CF-C85CE8E4975D}" EventSourceName="MSDTC" />
    <EventID Qualifiers="49152">4163</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>4</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2010-01-27T22:04:55.000000000Z" />
    <EventRecordID>1792</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>servera.mydomain.com</Computer>
    <Security />
  </System>
  <EventData>
    <Binary>4D005300440054004300</Binary>
  </EventData>
</Event>

I tried running msdtc -resetlog on SERVERA, but I get the same results.


I used DTCPing between SERVERA and SERVERC (also between SERVERA and SERVERB) and it reports that everything is working fine.


Environment:

SQLServer 2008 with all service applied.
Windows Server 2008 R2 with all service applied.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
check

http://social.msdn.microsoft.com/Forums/en/windowstransactionsprogramming/thread/71f7a219-c85d-4a04-973b-c73464f59606


 for MS DTC
Check   "Network DTC Access",
  "Allow Remote Clients",  
 "Allow Remote Administration",  
 "Allow Inbound", "Allow Outbound",  
 "No Authentication Required",  
  do not check "Enable Transaction Internet Protocal Transactions",  
 "Enable XA Transaction"
 


SQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018
Commented:
Kindly check whether MSDTC is enabled properly as per:

http://msdn.microsoft.com/en-us/library/ms936442%28CS.70%29.aspx

And make sure port 135 is excluded out of Windows Firewall along with msdtc.exe

Kindly check it out once by disabling Windows Firewall
Joseph HornseyPresident and Janitor

Author

Commented:
Thank you!
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
Welcome..

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial