BUG: Premature Query Timeout Under Dbmssoc3.dll

Last reviewed: April 8, 1997
Article ID: Q152132
The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 6.5

SYMPTOMS

When executing queries from a 16-bit Windows application using Dbmssoc3.dll, the query timeout can occur earlier than that set by the application. This problem occurs only if the application sends queries using blocking calls such as dbsqlexec() in DB-Library, and the timeout value is set to more than 60 seconds.

This problem can also occur in ODBC applications.

CAUSE

SQL Server socket net-library for windows (Dbmssoc3.dll) does not timeout correctly according to the value set by the DB-Library or ODBC applications.

WORKAROUND

There are two possible workarounds:

1) Use non-blocking calls to execute queries. For example, in DBLIB, instead of calling dbsqlexec(), you can call dbsqlsend() to send the query first, and then call dbdataready() repeatedly until it returns true, and finally call dbsqlok(). You'll need to implement your own timeout mechanism to break out of the dbdataready() loop. For more information, please consult the Programmer's Reference for C.

2) Set the timeout value to less than 60 seconds, and use a counter to control the accumulated timeout value until it is equal to the ideal setting. For instance, in DBLIB, you can code your error handler to always return INT_CONTINUE on the timeout error until the total amount of time waited is equal to your ideal setting. If you want to set the query timeout to 120, for example, you can set the initial timeout value to 30 seconds, and have the error handler return INT_CONTINUE until the timeout error occurs consecutively four times.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: tcp/ip sockets
Keywords : kbbug6.00 kbbug6.50
Version : 6.0 6.5
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.