Link to home
Start Free TrialLog in
Avatar of Joseph Hornsey
Joseph HornseyFlag for United States of America

asked on

How do I determine problem with DTC in distributed application?

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.
Avatar of EugeneZ
EugeneZ
Flag of United States of America image

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"
 


ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joseph Hornsey

ASKER

Thank you!
Welcome..