zoukankan      html  css  js  c++  java
  • Troubleshooting on TransactionScope

    We often met several kinds of errors when using TransactionScope in our applications and some settings are not proper.

    Here are some tips on how to resolve these issues.

    My scenario is, web application is running on server A, and database used by the web app is running on server B, both servers have firewalls enabled. 

    First when try to access the web app, I get below exception: 

    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. 

    The error message is obvious, so on server A, I come to Administrative Tools ->Component Services ->right-clicking on My Computer- >Properties->MSDTC, setting it as below: 

     

    When I try to access web app again, I get a similar exception shown below: 

    The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025) 

    This time, I made the same setting with previous step on server B on which the SQL Server is running. 

    Again, I get another error when access the web application, 

    Communication with the underlying transaction manager has failed. 

    When I searched on internet, I realized that because I have firewalls running on both servers, and the MSDTCs need get through them. So I configured the firewalls so that MSDTCs will not be blocked by the firewalls. My firewalls are coming with the windows operating system, so I added the msdtc.exe to the Exceptions tab of the windows Firewall window. 

    When I access the App, I get the same error as described previously. 

    It’s really frustrating, after some investigations, I modified the hosts file under C:WINDOWSsystem32driversetc on database server by adding 192.168.1.121 test-server in it, the IP is the web server’s IP and test-server is the name of the web-server. 

    This time, everything works fine, problem is resolved.

  • 相关阅读:
    Java Message Service学习(一)
    二叉树的层序遍历算法实现
    二叉树的操作之统计二叉树中节点的个数
    java.uti.Random类nextInt方法中随机数种子为47的奇怪问题
    最大子序列和问题
    参数对象Struts2中Action的属性接收参数
    方法字段[C# 基础知识系列]专题二:委托的本质论
    struts2属性Struts2中属性接收参数中文问题和简单数据验证
    权限检查联系人ProfileProvider
    最小较小codeforces 2B The least round way
  • 原文地址:https://www.cnblogs.com/shcity/p/3250421.html
Copyright © 2011-2022 走看看