MSDTC:与底层事务管理器通信失败 [英] MSDTC: Communication with the underlying transaction manager has failed

查看:2623
本文介绍了MSDTC:与底层事务管理器通信失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我想使用MSDTC交易这样一个WinForms / WCF / SQLServer的应用程序:

I have a WinForms / WCF / SQLServer app where I am trying to use MSDTC transactions like this:

using System.Transactions;

// ...

var transOptions =
    new TransactionOptions
    {
        IsolationLevel = IsolationLevel.ReadCommitted,
        Timeout = TimeSpan.FromSeconds(120)
    };

using (var scope = new TransactionScope(TransactionScopeOption.Required,
         transOptions))
{
    // ...

    if (everything_is_ok)
        scope.Complete();
}

在我的dev。框,服务器和客户端进程都在同一台机器上,它工作正常。但是,当我部署到QA ENV,其中服务器和客户端在不同的机器,每当 scope.Complete()被调用时,客户端挂起超时周期(2分钟),然后我得到:

On my dev. box, where the server and client processes are on the same machine, it works fine. But when I deploy to the QA env, where server and client are on separate machines, whenever scope.Complete() is called, the client hangs for the timeout period (2 minutes) and then I get:

在流过的事务不能解组。下面
异常:与基础事务管理器
没有通讯

The flowed transaction could not be unmarshaled. The following exception occurred: Communication with the underlying transaction manager has failed.

这是什么原因?

推荐答案

我花了几个小时,今天试图在Windows 7解决这个问题。最后,它的工作,这就是我所做的:

I spent few hours today trying to resolve this problem under Windows 7. Finally it worked, here's what I did:


  1. 启用MSDTC,并允许呼入/呼出的交易(通过控制面板)

  2. 通过注册表打开端口的指南 - 只需按照指南

  3. 允许定义的端口(2)是在您的防火墙(如果你使用一个)打开

  4. 通过Windows防火墙允许MSDTC - 添加新的规则对入站连接msdtc.exe(应该是在%SYSTEMROOT%\system32)

  1. Enable MSDTC and allow inbound/outbound transactions (via Control Panel)
  2. The guide for opening ports via registry - just follow the guide
  3. Allow ports defined in (2) to be open in your firewall (in case you use one)
  4. Allow MSDTC through the windows firewall - add new rule for inbound connections to msdtc.exe (should be in %systemroot%\system32)

这是也许不是最好的解决办法,但实际上,在我的情况下工作的唯一的一个。

This is maybe not the best solution but in fact the only one that worked in my case.

编辑:之后在Windows 7 SP1与MSDTC另一个问题,我发现有一个你需要为了做两件事情,使工作。

After another issue with MSDTC under Windows 7 SP1 I found out that there are two things you need to do in order to make it work.


  1. 添加到hosts文件
    服务器的IP和NetBIOS名称之间的映射。

  2. 添加(或编辑)两个键在HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\RPC:
    RestrictRemoteClients的= DWORD:00000000
    了EnableAuthEpResolution= DWORD: 00000000

这篇关于MSDTC:与底层事务管理器通信失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆