TransactionScope 无法与 DB2 提供程序一起使用
我一直在尝试将 TransactionScope 与 DB2 数据库(使用 DB2 .Net 提供程序 v 9.0.0.2 和 c# 2.0)一起使用,应该是根据 IBM 的支持。
我已经尝试了在 IBM 论坛上可以找到的所有建议(例如 此处)无济于事。
我在我的 XP Sp2 机器上启用了 XA 事务,也从 Win 2003 Server 机器上尝试过,但我始终遇到臭名昭著的错误:
错误 [58005] [IBM][DB2/NT] SQL0998N 期间发生错误
事务或启发式处理。 原因代码=“16”。子代码 = “2-80004005”。 SQLSTATE=58005
Windows 事件日志显示:
XA 事务管理器尝试加载 XA 资源
管理器 DLL。对 LOADLIBRARY 的调用 用于 XA 资源管理器 DLL 失败的: DLL=C:\APPS\IBM\DB2v95fp2\SQLLIB\BIN\DB2APP.DLL 文件=d:\comxp_sp2\com\com1x\dtc\dtc\xatm\src\xarmconn.cpp 行=2467。
此外,授予 NETWORK SERVICE 用户对该文件夹和 dll 的完全权限。
这是 MSDTC 启动消息
MS DTC 开始于以下内容 设置:
安全配置(关闭 = 0 且 开 = 1): 交易网络管理 = 0, 网络客户端 = 0, 使用本机 MSDTC 协议的入站分布式事务 = 0, 使用本机 MSDTC 的出站分布式事务 协议 = 0, 交易互联网协议(TIP)= 0, XA 交易 = 1
任何帮助将不胜感激!
谢谢, 弗罗林
I've been trying to use TransactionScope with a DB2 database (using DB2 .Net provider v 9.0.0.2 and c# 2.0) which SHOULD be supported according to IBM.
I have tried all the advice i could find on the IBM forums (such as here) to no avail.
I have enabled XA transactions on my XP Sp2 machine, tried also from a Win 2003 Server machine but i consistently get the infamous error:
ERROR [58005] [IBM][DB2/NT] SQL0998N Error occurred during
transaction or heuristic processing.
Reason Code = "16". Subcode =
"2-80004005". SQLSTATE=58005
The windows event log says:
The XA Transaction Manager attempted to load the XA resource
manager DLL. The call to LOADLIBRARY
for the XA resource manager DLL
failed:
DLL=C:\APPS\IBM\DB2v95fp2\SQLLIB\BIN\DB2APP.DLL
File=d:\comxp_sp2\com\com1x\dtc\dtc\xatm\src\xarmconn.cpp
Line=2467.
Also, granted the NETWORK SERVICE user full rights to the folder and dll.
Here's the MSDTC startup message
MS DTC started with the following
settings:Security Configuration (OFF = 0 and
ON = 1):
Network Administration of Transactions = 0,
Network Clients = 0,
Inbound Distributed Transactions using Native MSDTC Protocol = 0,
Outbound Distributed Transactions using Native MSDTC
Protocol = 0,
Transaction Internet Protocol (TIP) = 0,
XA Transactions = 1
Any help would be much appreciated!
Thanks,
Florin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我设法让老旧的 IBM DB2 v7 ODBC 驱动程序在 TransactionScope 中工作。它需要:
我不确定这是否与您的特定场景相关。 IBM 文档 将原因代码 16、子代码 2 显示为“MSDTC 无法注册 DB2 连接”。 MSDTC 查找 DB2 dll 时似乎存在一些问题 - 也许检查上面引用的注册表项?
I managed to get the creaky old IBM DB2 v7 ODBC driver working in a TransactionScope. It required:
I'm not sure if this is relevant to your particular scenario. The IBM documentation shows reason code 16, subcode 2 as "The MSDTC is unable to register the DB2 connection." There appears to be some issue with MSDTC finding the DB2 dll - perhaps check the registry key referenced above?
我通过激活 MS DTC 解决了这个问题,如下图所示:
重新启动计算机并重试。确保您拥有最新的 IBM 驱动程序。我使用 10.1 Fix Pack 1 和 Informix 11.50 进行了测试。
来源:http://blogs.msdn.com/b/bill/archive/2006/12/12/using-msdtc- Between-vista-clients-and-windows-2000-servers.aspx
I solved this issue by activating MS DTC as in the image below:
Reboot your machine and try again. Make sure you have the latest IBM Drivers. I tested with 10.1 Fix Pack 1 and Informix 11.50.
Source: http://blogs.msdn.com/b/bill/archive/2006/12/12/using-msdtc-between-vista-clients-and-windows-2000-servers.aspx