Click here to Skip to main content

Configure Distributed Transaction In a System

Introduction

This post is for helping people who would like to use distributed transactions in their programs. The post clarifies how to set up MSDTC and also the various errors that normally arise.

Steps

  1. In Run, type dcomcnfg.
  2. Expand Component Services.
  3. Expand Computers.
  4. Right click My Computer, click Properties.
  5. Go to MSDTC Tab.
  6. Under Transaction Configuration, click Security Configuration Button.
  7. In the Security Settings Section, check the following:
    1. Network DTC Access
    2. Allow Inbound
    3. Allow Outbound
    4. No authentication required

Reference: http://support.microsoft.com/kb/839279 

Common Errors Occurring in Transaction

  1. Network access for Distributed Transaction Manager(MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative Tool (HRESULT : 0x8004D024).

    Configure MSDTC following the above method.

  2. MSDTC on server is unavailable.

    Ensure that Distributed Transaction Coordinator is running on both client and server machines.

    To check whether Distributed Transaction Coordinator is running:

    1. Right click My Computer, go to Services.
      Start Distributed Transaction Coordinator.

      (Or)

    2. Open Enterprise Manager.
      Under Supported Services, start Distributed Transaction Coordinator.
  3. Transaction has either implicitly or explicitly committed, rolled back or aborted (HRESULT 0x8004D00E)
    1. Check the firewall settings:
      1. In Run, type firewall.cpl.
      2. Click Exceptions Tab.
      3. Click Add Program.
      4. Browse for Msdtc.exe (normally found under C:\Windows\System32).
      5. Click Add Port.
      6. In the Add A Port window, give a name in the Name field.
      7. Give 135 in the Port Number Field.
      8. Select TCP.
      9. Click OK.

      (Or)

    2. Check the network settings:
      • Ping the server from client and client from server.
      • If the ping succeeds, check whether any LoopBackAdapter is present.
      • If there is a loopback adapter, uninstall it and reboot the machine.

      Confirm that the error no longer exists. Then, install the loopback adapter.

  4. Distributed Transaction has completed. Either enlist this session in a new transaction or the NULL transaction.

    Check whether TransactionScope.Complete() has been called.


Web01 | 2.8.160204.4 | Advertise | Privacy
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service