MS SQL Server ODBC Driver hanging code when using multiple active statements and SQLGetData
- From: "Todor Todorov" <cdm@xxxxxxxxxxxxx>
- Date: Thu, 1 Feb 2007 15:21:00 +0100
Hang occurs in the MS Server Server ODBC driver where it appears to be in a spinwait. It seems to happen when I start receiving a column's data in one statement and then go off and do something with another statement. This can easily be duplicated in MS's odbctest utility.
Now in ODBC terms do this:
* connect
* allocate stmt1
* SQLSetStmtAttr(stmt1, SQL_ATTR_CURSOR_TYPE = SQL_CURSOR_STATIC)
* allocate stmt2
* SQLSetStmtAttr(stmt2, SQL_ATTR_CURSOR_TYPE = SQL_CURSOR_STATIC)
* Now we have two statements and because the cursor is STATIC, the
* MS SQL Server ODBC driver will allow us to have multiple active statements.
* SQLExecDirect(stmt1, 'select * from ....')
* SQLFetch(stmt1)
* SQLGetData(stmt1, column=2, BufferLength=500)
* This will return SQL_SUCCESS_WITH_INFO as there is over 500B of data
* and we have only retrieved 500 bytes so far.
* SQLExecDirect(stmt2, 'select * from ...')
* This hangs and if you examine the application you will see the code
* is looping (spin waiting) inside the MS SQL Server ODBC driver.
A stack trace could look like (sorry, I did not had access to the symbol files):
Call stack of main thread
Address Stack Procedure / arguments Called from Frame
0012CF08 4CA535EE SQLSRV32.4CA53558 SQLSRV32.4CA535E9 0012CF04
0012CF24 4CA93651 SQLSRV32.4CA535B9 SQLSRV32.4CA9364C 0012CF20
0012CF58 4CA951C5 SQLSRV32.4CA934F2 SQLSRV32.4CA951C0 0012CF54
0012CF88 4CA69A52 SQLSRV32.4CA9515A SQLSRV32.4CA69A4D 0012CF84
0012CFA0 4BF79B84 SQLSRV32.4CA69A52 odbc32.4BF79B81 0012CF9C
0012CFC4 4BF798B0 odbc32.4BF79AFD odbc32.4BF798AB 0012CFC0
0012CFE0 10017D56 Includes odbc32.4BF798B0 VVM31W.10017D53 0012CFDC
0012E128 016C3507 ? VVM31W.10017D10 016C3502 0012E108
The problem is also described here:
http://www.easysoft.com/developer/languages/php/apache_odbc.html#appb2
Can you please confirm or disconfirm this issue? If it is an issue in SQLSRV32.DLL, is there a work around or a solution? Most important, is there a KB article describing this?
.
- Follow-Ups:
- Prev by Date: importing csv file +iis
- Next by Date: ODBC Driver for XML
- Previous by thread: importing csv file +iis
- Next by thread: RE: MS SQL Server ODBC Driver hanging code when using multiple active statements and SQLGetData
- Index(es):
Relevant Pages
|
|