我在应用程序中设置事务时遇到问题。当我执行轻量级事务时,它可以工作:
using (TransactionScope tx = new TransactionScope())
{
// Connect to Server 1 in a transaction
tx.Complete()
}当我执行嵌套事务时,它失败了:
using (TransactionScope tx = new TransactionScope())
{
// Connect to Server 1 in a transaction
using (TransactionScope tx2 = new TransactionScope())
{
// Connect to Server 2 in a transaction
tx2.Complete()
}
tx.Complete()
}我得到的错误是:
The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B)当我在服务器上运行相同的代码时,它可以工作。我在计算机上运行/配置了MSDTC (设置与服务器相同)。
我们的网络部门说,他们在防火墙上没有看到任何被阻止的流量。
我可以从我的计算机对服务器执行DTC Ping操作,但不能从服务器返回。
有什么想法吗?我认为这是一个网络问题,但需要一些帮助。
发布于 2012-11-30 01:05:21
I可以从我的计算机对服务器执行DTC Ping操作,但不能从服务器返回。
这似乎是原因所在。MSDTC要求两台机器都可以通过NetBios名称看到对方。您应该能够使用'nbtstat -a xxx.xxx‘解析IP来命名这两种方式。
此外,还必须在两台计算机上打开端口135。
发布于 2012-11-30 04:37:58
事实证明这是一个防火墙问题。谢谢。
https://stackoverflow.com/questions/13630867
复制相似问题