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
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
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?