TransactionScope将无法使用DB2提供程序 [英] TransactionScope won't work with DB2 provider
问题描述
我一直在尝试使用 DB2 数据库(使用 DB2 .Net 提供程序v 9.0.0.2和c#2.0)使用 TransactionScope 应该根据IBM支持。
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.
我已经尝试了在IBM论坛上可以找到的所有建议(例如 here )无效。
I have tried all the advice i could find on the IBM forums (such as here) to no avail.
我有在我的XP Sp2机器上启用XA事务,也尝试从Win 2003 Server机器,但我一直得到臭名昭着的错误:
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
交易或启发式处理。
原因代码=16。子码=
2-80004005。 SQLSTATE = 58005
transaction or heuristic processing. Reason Code = "16". Subcode = "2-80004005". SQLSTATE=58005
Windows事件日志说:
The windows event log says:
The XA Transaction Manager attempted to load the XA resource
manager DLL。对于XA资源管理器DLL
,对LOADLIBRARY
的调用失败:
DLL = C:\APPS\IBM\DB2v95fp2\SQLLIB\BIN\DB2APP.DLL
文件= d:\comxp_sp2\com\com1x\dtc\dtc\xatm\src\xarmconn.cpp
Line = 2467。
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.
此外,授予NETWORK SERVICE用户对该文件夹和dll的完全权限。
Also, granted the NETWORK SERVICE user full rights to the folder and dll.
这是MSDTC启动消息
Here's the MSDTC startup message
MS DTC从以下
设置开始:
MS DTC started with the following settings:
安全配置OFF = 0和
ON = 1):
网络管理事务= 0,
网络客户端= 0,
使用本机MSDTC协议的入站分布式事务= 0,
使用本地MSDTC的出站分布式事务
协议= 0,
事务Internet协议(TIP)= 0,
XA事务= 1
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
任何他lp将非常感谢!
Any help would be much appreciated!
谢谢,
Florin
Thanks, Florin
推荐答案
我设法获得了在TransactionScope中工作的令人cre y的旧IBM DB2 v7 ODBC驱动程序。它需要:
I managed to get the creaky old IBM DB2 v7 ODBC driver working in a TransactionScope. It required:
- 在MSDTC属性中启用XA事务
- 在注册表项HKLM下输入的值\SOFTWARE\Microsoft\MSDTC\XADLL,名称为DB2CLI.DLL,值为C:\PROGRA〜1\IBM\SQLLIB\BIN\DB2CLI.DLL(到8.3中的dll路径格式 - v9使用DB2APP.DLL)
- 重启
- 在TransactionScope处理之前未关闭连接。回想起来似乎很明显。 :)
- XA transactions enabled in MSDTC properties
- A value entered under the registry key HKLM\SOFTWARE\Microsoft\MSDTC\XADLL with name 'DB2CLI.DLL' and value 'C:\PROGRA~1\IBM\SQLLIB\BIN\DB2CLI.DLL' (path to dll in 8.3 format - v9 uses DB2APP.DLL)
- A reboot
- Not closing the connection prior to the TransactionScope being disposed. It seems obvious in retrospect. :)
我不知道这是否与您的特定场景相关。 IBM文档将原因代码16,子代码2显示为MSDTC无法注册DB2连接。 MSDTC找到DB2 dll似乎有一些问题 - 也许检查上面引用的注册表项?
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?
这篇关于TransactionScope将无法使用DB2提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!