简体   繁体   English

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

[英]MSDTC and Multiple Databases with Entity Framework

In my code I'm attempting to use a transaction using TransactionScope with Entity Framework. 在我的代码中,我试图使用TransactionScope与Entity Framework进行交易。 While in this transaction we are opening a regular SQL connection to a seperate server and database. 在此事务中,我们正在打开与单独服务器和数据库的常规SQL连接。 When the conn.Open() is called we get an Error: 当conn.Open()被调用时,我们得到一个错误:

"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." “已禁用分布式事务管理器(MSDTC)的网络访问。请使用Componet Services管理工具在MSDTC的安全配置中启用DTC以进行网络访问。”

However, MSDTC is enabled and running on the Server. 但是,MSDTC已在服务器上启用并运行。

1) Just to be sure but have you really confirmed that DTC is running. 1)只是确定但是你确实已经确认DTC正在运行。 Right mouse click on "My Computer" from your Component Services screen. 在“组件服务”屏幕上右键单击“我的电脑”。 The top menu item should say "Stop DTC". 顶部菜单项应显示“停止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)? 2)您是否检查过两端的MSDTC配置是否相同(启动与数据库和数据库服务器连接的应用程序服务器)? Pay special attention to the Security Configurations under your MSTDC tab 请特别注意MSTDC选项卡下的安全配置

Good luck 祝好运

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. 您需要在Web服务器和SQL Server上启用MS DTC,并在两台计算机上启用远程事务。 I've got walk throughs for Windows 2003 and Windows 2008 up on my blog. 我已经在我的博客上浏览了Windows 2003Windows 2008

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. 我曾经在办公室里失去了一整天,因为发现前一天晚上运行的Windows Update操作恢复了Windows防火墙的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM