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'"

据我所知,资源管理器应该以正确的方式在每个数据库中保留一个。
您是否知道任何原因可能触发这种意外行为,导致过多的Resource Manager(每个都有不同的GUID)?

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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)