BUG: SQL Server's ODBC Function SQLConnect is Not Thread Safe

ID: Q151593


The information in this article applies to:

BUG#: 13031 (6.00)

SYMPTOMS

When a threaded application performs many simultaneous open connections, the application can abnormally terminate. If running a Windows based application it can simply disappear. If running a console based application it may produce the following:

Assertion failed: (Status == ERROR_OUTOFMEMORY) || (Status == ERROR_NOT_ENOUGH_MEMORY) || (Status == ERROR_CANTREAD) || (Status == ERROR_FILE_NOT_FOUND)

Either environment can cause Dr. Watson, or system debugger, to be activated. In some cases, the debugger will report OS error 87,'Invalid parameters passed to the debugger'.


CAUSE

The connection functions SQLConnect and SQLDriverConnect are not thread safe.


WORKAROUND

Serialize all calls to open a connection.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server 6.00 Service Pack 1 (SP1). The SQL Server ODBC Driver has been corrected in the Microsoft SQL Server 6.50 release.

Additional query words: 6.00 sp


Keywords          : SSrvProg 
Version           : 6.00 2.50.0126
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 27, 1999