Microsoft KB Archive/152062

From BetaArchive Wiki
Knowledge Base


Article ID: 152062

Article Last Modified on 3/14/2006



APPLIES TO

  • Microsoft SQL Server 6.0 Standard Edition
  • Microsoft SQL Server 6.5 Standard Edition



This article was previously published under Q152062

BUG #: 15252 (SQLBUG_60_RW and SQLBUG_65)

SYMPTOMS

When you use DBMSRPC3.DLL to connect to SQL Server, a Win16 application can prematurely time out the query. For example, if the query timeout is set to 55 seconds using dbsettime() in a DB-Library application, the query will timeout within 10 seconds. With settings under 30 seconds, the query timeout setting works fine.

CAUSE

The timeout mechanism in ConnectionRead() of the client-side Net-Library DBMSRPC3.DLL incorrectly calculates the timeout setting under certain situations.

WORKAROUND

Use either of the following to work around the problem:

  • 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 ODBC applications, you can avoid this by using asynchronous mode. For more information, please consult the Programmer's Reference for C. -OR-


  • Set the timeout value to less than 30 seconds, and use a counter to control the accumulated timeout value until it is equal to the ideal setting. For instance, in DBLIB, use dbsettime() to set a value less than 30 seconds, and 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. As an example, if you want to set the query timeout to 120, you can set the initial timeout value to 30 seconds, and have the error handler return INT_CONTINUE until the timeout error occurs consecutively for four times.


STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.0.

Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a


For more information, contact your primary support provider.

MORE INFORMATION

This is a Net-Library specific issue. It occurs when the application API (DBLIB or ODBC) calls the Net-Library API function ConnectionRead() to read results from the server. The timeout value parameter is correctly passed to ConnectionRead(), but the function does not wait long enough before timing out. This problem can affect both DBLIB and ODBC applications.

Keywords: kbbug kbfix KB152062