COM+VB6应用程序:RM_ENLIST_FAILED_TOO_MANY_ENLISTS错误



我遇到了一个从VB6应用程序(Com+(启动的事务的奇怪行为,这个遗留应用程序在同一事务中调用多个对DB2和SQLServer的查询
返回的错误为:

[Microsoft][ODBC Driver Manager] Failed to enlist on calling object's transaction query=SELECT COUNT (*) as FOO FROM BAR
FOR FETCH ONLY WITH UR SorgenteErr: Microsoft OLE DB Provider for ODBC Drivers
9:42:42 AM [2032]: Error: -2147467259

通常msdtc日志显示2资源管理器的登记,如以下所示:

pid=2440       ;tid=4636       ;time=10/08/2020-10:48:11.404   ;seq=535        ;eventid=RM_ENLISTED_IN_TRANSACTION               ;tx_guid=bed0e21a-c138-4ff0-a94e-3dd819694ef7     ;"TM Identifier='(null)                                            '" ;"resource manager #1002 enlisted as transaction enlistment #1. RM guid = '62f2ad11-5eab-45f9-89d6-53d7488cfb6e'"
pid=2440       ;tid=4636       ;time=10/08/2020-10:48:11.545   ;seq=536        ;eventid=RM_ENLISTED_IN_TRANSACTION               ;tx_guid=bed0e21a-c138-4ff0-a94e-3dd819694ef7     ;"TM Identifier='(null)                                            '" ;"resource manager #1003 enlisted as transaction enlistment #2. RM guid = 'bd440a1c-7334-4170-b1d5-a5c9e25eb1a0'"

在一种情况下,当查询数量由于某些应用程序逻辑而增加时,我们正在经历一种奇怪的行为
通常应用程序按预期工作,但有时资源管理器会奇怪地从2增加到32,从而触发RM_ENLIST_FAILED_TOO_MANY_ENLISTS错误。

attempt to enlist the resource manager failed because the limit on number of maximum enlistments has been reached.

pid=2440       ;tid=4636       ;time=10/23/2020-10:48:17.810   ;seq=566        ;eventid=RM_ENLISTED_IN_TRANSACTION               ;tx_guid=bed0e21a-c138-4ff0-a94e-3dd819694ef7     ;"TM Identifier='(null)                                            '" ;"resource manager #1033 enlisted as transaction enlistment #32. RM guid = '5596fb4e-6c48-441c-af48-2d17adfb4ea0'"
pid=2440       ;tid=4636       ;time=10/23/2020-10:48:18.092   ;seq=567        ;eventid=RM_ENLIST_FAILED_TOO_MANY_ENLISTS        ;tx_guid=bed0e21a-c138-4ff0-a94e-3dd819694ef7     ;"TM Identifier='(null)                                            '" ;"attempt to enlist the resource manager failed because the limit on number of maximum enlistments has been reached. RM guid = 'e260c743-46b4-4f96-a343-1553bc7974eb'"

据我所知,资源管理器应该为每个数据库保留一个正确的行为
您知道有什么原因会触发这种意外行为吗?招募了太多的资源管理器(每个资源管理器都有不同的guid(?

需要注意的一点是,当我们在客户端机器和Db2连接机器上从9.7 FP 9a切换到11.1.4 FP5 Db2驱动程序时,这种行为就开始了。

如果您已将驱动程序(升级到位安装(从9.7升级到11.1,请尝试重新安装驱动程序(卸载、新安装、目录节点和数据库(如果需要(以及自定义配置(。从9.7升级可能会在配置中留下一些不正确的地方,这可能会导致XA事务出现问题。