Solve the problem that "COM + cannot talk with Microsoft Distributed Transaction Coordination Program"

Source: Internet
Author: User
In the past two days, I tried Ms DTC, installed two SQL Server servers on two computers, and compiled a transaction processing component bankservice: [Transaction (transactionoption. Required)]
Public   Class Bankservice: system. enterpriseservices. servicedcomponent
{
Public Bankservice ()
{
}

Public   Void Drawmoneyfroma ( Long Amount)
{
Sqlconnection CN =   New Sqlconnection ( " Data Source = ekeen; uid = sa; Pwd = sa; initial catalog = Bank " );
Sqlcommand cmd =   New Sqlcommand ( " Update accounts set amount = (amount "   + Amount. tostring () +   " ) Where accountid = 'A' " , CN );
Try
{
CN. open ();
Cmd. executenonquery ();
}
Catch (Exception ex)
{
ThrowEx;
}
Finally
{
CN. Close ();
}


}

Public   Void Depositmoneytob ( Long Amount)
{
Sqlconnection CN =   New Sqlconnection ( " Server = (local); Integrated Security = true; initial catalog = Bank " );
Sqlcommand cmd =   New Sqlcommand ( " Update accounts set amount = Amount + "   + Amount. tostring () +   " Where accountid = 'B' " , CN );
CN. open ();
Cmd. executenonquery ();
CN. Close ();
}

[AutoComplete]
Public   Void Testdtc ()
{
Drawmoneyfroma (100);
Depositmoneytob (100);


}
}

However, when I call the testdtc () method to test DTC, the CN in the drawmoneyfroma method is executed. when the open method is used, an exception is thrown. "The partner Transaction Manager has disabled remote/network transaction support." No reason is found.
Later, I right-click "my computer" in the component configuration. When selecting properties, I found that the "MSDTC" tab had a default Coordinator option. As a result, I thought whether a computer should be designated as the coordinator, so I entered the name of another test machine, ekeen, and OK. The result is a nightmare: the error "COM + cannot talk to Microsoft Distributed Transaction Coordinator" occurs every time a transaction is executed ". I think the configuration was wrong, but when I want to configure MSDTC again, I find that I can no longer open the tab ~~~.
In desperation, I went to see the event viewer and found that there is a COM + error. According to the results, I found a KB article http://support.microsoft.com /? Kbid = 867520, which indicates the solution:
1. Delete the keys in the registry:

HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ MSDTC
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ MSDTC
Hkey_classes_root \ CID

2. Stop MSDTC: net stop MSDTC
3. Uninstall the MSDTC Service: MSDTC-uninstall
4. reinstall the MSDTC Service: MSDTC-install
5. restart the computer

After the problem is solved, you can configure MSDTC, but the problem of "the partner Transaction Manager has disabled its support for remote/network transactions" still persists. I don't know who can help me, thank you.

My operating system is Windows 2003 and the database is SQL Server 2003 + SP3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.