MSDTC 和具有实体框架的多个数据库

发布于 2024-09-05 23:36:17 字数 249 浏览 7 评论 0原文

在我的代码中,我尝试将 TransactionScope 与实体框架结合使用。在此事务中,我们打开到单独服务器和数据库的常规 SQL 连接。当调用 conn.Open() 时,我们得到一个 错误:

“分布式事务管理器 (MSDTC) 的网络访问已被禁用。请使用 Componet 服务管理工具在 MSDTC 的安全配置中启用 DTC 的网络访问。”

但是,MSDTC 已启用并在服务器上运行。

In my code I'm attempting to use a transaction using TransactionScope with Entity Framework. While in this transaction we are opening a regular SQL connection to a seperate server and database. When the conn.Open() is called we get an
Error:

"Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Componet Services Administrative tool."

However, MSDTC is enabled and running on the Server.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情未る 2024-09-12 23:36:19

您需要在 Web 服务器和 SQL Server 上启用 MS DTC,并在两台计算机上启用远程事务。我有 Windows 2003 的演练Windows 2008 在我的博客上。

You'll need to enable MS DTC on both the web server, and the SQL Server, as well as enable remote transactions on both machines. I've got walk throughs for Windows 2003 and Windows 2008 up on my blog.

陌生 2024-09-12 23:36:19

还要检查防火墙。有一次,我在办公室里浪费了一整天的时间,因为我发现前一天晚上运行的 Windows 更新操作恢复了 Windows 防火墙的默认值。

Check also firewall. I once, lost a whole day in office, for discovering that the Windows Update operation, that had run the previous night, restored the default values of Windows Firewall.

半山落雨半山空 2024-09-12 23:36:18

1) 只是为了确定,但您是否确实确认 DTC 正在运行。在“组件服务”屏幕上右键单击“我的电脑”。顶部菜单项应显示“停止 DTC”。

2) 您是否检查过两端(启动数据库连接的应用程序服务器和数据库服务器)的 MSDTC 配置是否相同?
特别注意 MSTDC 选项卡下的安全配置

祝你好运

1) Just to be sure but have you really confirmed that DTC is running. Right mouse click on "My Computer" from your Component Services screen. The top menu item should say "Stop DTC".

2) Have you checked that your configuration of MSDTC is the same on both ends (your application server that initiates connection to the database and at your database server)?
Pay special attention to the Security Configurations under your MSTDC tab

Good luck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文