Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: MTS COM Object Fails to Pool OLE DB Connections


View products that this article applies to.

This article was previously published under Q278842

↑ Back to the top


Symptoms

This article requires a good knowledge of Component Object Model (COM), Microsoft Transaction Server (MTS), and any language to build COM components like Microsoft Visual Basic or Visual C.

Multiple connections accrue on a SQL Server database or other databases as Component Object Model (COM) objects are called using Requires New transaction support.

↑ Back to the top


Cause

The Microsoft Transaction Server (MTS) resource manager fails to clean up the pooled connection status when the SetComplete function is called. Therefore, connections used in Requires New transactions are not reused.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This bug has been fixed in Microsoft Data Access Components (MDAC) 2.6.

↑ Back to the top


More information

Steps to Reproduce the Behavior

The scenario for this bug to occur is very specific.
  1. Set up three COM objects in MTS.
  2. In MTS, mark your three COM components as follows:
    The first object (obj1): Requires transactions
    The second object (obj2): Requires new transactions
    The third object (obj3): Supports transactions
  3. Have the client application call a method on obj1. The method in obj1 has a loop. In the loop the method in object1 calls a method of obj2 that connects with a database using an OLEDB provider (SQLOLEDB or MSDAORA), disconnects from the database, and then calls the SetComplete function. The method of obj2 connects a second time with the same database by using the same connection string, disconnects from the database, calls SetComplete, and then returns to obj1.

    Now, obj1 calls a method of obj3. This method in obj3 connects with the same database by using the same connection string used in obj2. The method in obj3 then disconnects, calls SetComplete, and returns to obj1.

    Next, obj1 calls SetComplete and continues its loop.

    NOTE: Make sure that the session pooling service is not disabled for your OLE DB provider before you set up your components in MTS.

    The end result is that the connections are entered into the session pool but they are not reused. To see this, use Perfmon and note the increasing spike when you watch the number of user connections on SQL Server.

↑ Back to the top


References

For more information, refer to the Microsoft Developer Network (MSDN) documentation.

↑ Back to the top


Keywords: KB278842, kbmdac260fix, kbfix, kbbug

↑ Back to the top

Article Info
Article ID : 278842
Revision : 3
Created on : 10/17/2003
Published on : 10/17/2003
Exists online : False
Views : 415