TransactionScope won't work with DB2 provider

那年仲夏 提交于 2019-12-04 16:19:40

I managed to get the creaky old IBM DB2 v7 ODBC driver working in a TransactionScope. It required:

  • 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. :)

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?

I solved this issue by activating MS DTC as in the image below:

  1. run dcomcnfg;
  2. Component Services > Computers > My Computer > Distributed Transaction Coordinator
  3. Select Local DTC > Properties > Security Tab:

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!