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: WriterLock In OLE DB Core Components Can Starve Readers When WriterLock Opens Connections


View products that this article applies to.

This article was previously published under Q267566

↑ Back to the top


Symptoms

Under stress, a bug in the OLE DB Service Components may cause a thread to go into an extremely tight loop, which can cause 100% CPU utilization and thread starvation.

Applications such as Microsoft Internet Information Server (IIS), Microsoft Transaction Server (MTS) and COM+ applications may appear to have stopped responding (hang), when in fact the remaining threads in the process are getting very little context and are unable to complete their operations.

↑ Back to the top


Cause

Stressing the OLE DB Service Components with a high number of connection requests can cause contention on the hash tables that contain connection information. When this contention occurs, a thread in the process can enter a for loop that will not exit until the release of an item that is held by other threads in the process. Because this for loop does not contain much code, it runs in an extremely tight loop that causes 100% CPU utilization and starves the other threads for context, so the release never occurs. The for loop does not occasionally yield execution as it should.

This for loop exists in the WriterLock code that protects access to the hash tables. If the threads in the process are examined while the program seems to have stopped responding, one thread is running in the WriterLock code, and numerous other threads are in the ReaderLock code, waiting for a critical section owned by the WriterLock thread.

↑ Back to the top


Resolution

To resolve this problem, obtain the latest service pack for Microsoft Data Access Components 2.5. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
293312� INFO: How to Obtain the Latest MDAC 2.5 Service Pack
The English version of this fix should have the following file attributes or later:
   Date      Version         Size             File name    
   ------------------------------------------------------
   5/3/00    2.510.5303.0    483,600 bytes    Oledb32.dll
				
NOTE: The installer package for this hotfix (Q267566_W2K_SP1_x86_en.EXE) is designed to run on Microsoft Windows 2000 platforms, and will not run on Microsoft Windows NT 4.0, Microsoft Windows 95 or Microsoft Windows 98 platforms. For this reason, the standalone hotfix file is provided as well so that you can copy it directly to Windows NT 4.0, Windows 95 or Windows 98 platforms. The installer package contains the exact same file, which has the attributes indicated in this section.


WORKAROUND

To work around this problem, disable session pooling by using any of the following methods:
  • Set the OLEDB_SERVICES value for the provider to 0xfffffffc in the registry.

  • Add "OLE DB Services = -2" to the connection strings that the application uses.

  • If you use pure OLE DB code, add code similar to the following to the initialization properties:

    //	OLE DB Services
    	InitProperties[0].dwPropertyID = DBPROP_INIT_OLEDBSERVICES;
    	InitProperties[0].vValue.vt = VT_I4;
    	InitProperties[0].vValue.lVal = DBPROPVAL_OS_ENABLEALL & ~ DBPROPVAL_OS_RESOURCEPOOLING;	
    					

↑ 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 problem was first corrected in Microsoft Data Access Components 2.5 Service Pack 2.

↑ Back to the top


Keywords: KB267566, kbqfe, kbmdac250sp2fix, kbmdac250sp1fix, kbfix, kbcodesnippet, kbbug, kbqfe, kbhotfixserver

↑ Back to the top

Article Info
Article ID : 267566
Revision : 3
Created on : 9/26/2005
Published on : 9/26/2005
Exists online : False
Views : 487