同一个TransactionScope中不能操作两个及其以上的DATABASE
来源:互联网 发布:国产开源软件 编辑:程序博客网 时间:2024/05/02 01:41
最近用LINQ TO SQL,有些事情是需要原子性操作的,因此就用了一下事务,即TransactionScope。
但是在使用中发现如下的一个错误,查了很多资料才解决,在此分享一下:
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. InnerException:
System.Runtime.InteropServices.COMException (0x8004D024): The transaction
manager has disabled its support for remote/network transactions. (Exception
from HRESULT: 0x8004D024)
at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32
propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid&
transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel,
ITransactionShim& transactionShim)
at
System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropiga
tionToken(Byte[] propagationToken)
Communication with the underlying transaction manager has failed.
InnerException: System.Runtime.InteropServices.COMException (0x8004D02B): 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)
at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32
propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid&
transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel,
ITransactionShim& transactionShim)
at
System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropiga
tionToken(Byte[] propagationToken)
开始以为和MSDTC服务有关,在网上搜索了相关资料并按照其设置之后,问题依旧。
以后发现问题的原因在于在同一个TransactionScope里面,试图操作两个不同的DATABASE导致的,把其中一个数据库操作提出来即可……
- 同一个TransactionScope中不能操作两个及其以上的DATABASE
- WCF 运行的时候 报错 提示 “ 同一个协定中不能存在两个名称相同的操作”
- TransactionScope分布式事务,将两个数据库操作放在一个事务中
- C#中TransactionScope的使用方法
- EntiryFramework中事务操作(二)TransactionScope
- EFCore废弃了TransactionScope取而代之的Context.Database.BeginTransaction
- 乐观锁(两个以上用户不能同时进行同一操作)
- 同一个页面中两个框架之间的链接问题
- 同一个项目中两个jqery版本共存的问题
- C#语言中TransactionScope类的使用
- C#语言中TransactionScope类的使用
- C#语言中TransactionScope类的使用
- C#中TransactionScope的使用方法和原理
- C#中TransactionScope的使用方法和原理
- oracle database link的建立方法,两个数据库的操作
- TransactionScope使用说明 原子操作
- K3中注册同一个单据内部的操作插件
- ABAP中两个DATABASE TABLE 的JOIN方法
- google公开深度学习部分应用
- Qt环境变量的设置,Qt程序运行时提示缺少mingwm10.dll、QtCore4.dll的解决方法
- 基础博弈总结
- 退出多个Activity的方法
- 如何把sqlserver中的列转换成行,行转换成列,显示
- 同一个TransactionScope中不能操作两个及其以上的DATABASE
- linux网络相关命令
- PE文件格式分析及修改
- iOS Newsstand Tutorial
- Android setColorFilter 滤镜效果
- 将程序添加到右键菜单(以Sublime Text为例)
- 如何设置xcode中iPhone模拟器类型
- 关于如何在代码里区分条码扫描扫描到是是一维码还二维码
- 每日一题(1) - 二维数组中的查找