DB Library error or assertion when cancelling a long running procedure

DB Library error or assertion when cancelling a long running procedure

Post by iam ho » Thu, 16 May 2002 05:11:48



Hello,

I have no understanding why I am getting this assertion in the
DB-Library.
I am developing a multi-threaded database application where a user can
execute what ever SQL statement in a secondary thread. When the user
wishes to cancel, the main thread issues the cancel by calling the
DB-Library command:
 dbCancel();

However, as soon as I call this function, I get a run time assertion
below:
-------------------
Program: MyThreadedApp.exe
File: q:\SPHINX\NETLIBS\nt\ssock\src\ntssockc.c
Line: 597

Expression: 1 == pConnectionObject->fCallCheck
-------------------------

I can not make head or tails about this assertion. Am I making any
errors here? Whenever I get these assertions my connection is rendered
useless and any other chance to reconnect or even clone the connection
I get DB-Library messages below:
-- Possible network error: Bad token from SQL Server: Datastream
processing out of sync.
-- Possible network error: Bad token from SQL Server: Datastream
processing out of sync.  General network error.  Check your
documentation.
--ConnectionClose (closesocket()).

This bug is reproducible a NT and Windows 2000 client. I have not
tested it on Win98.

Please help.

Thanks,

Iam

 
 
 

DB Library error or assertion when cancelling a long running procedure

Post by Erland Sommarsko » Thu, 16 May 2002 06:29:54


[posted and mailed, please reply in news]


> I have no understanding why I am getting this assertion in the
> DB-Library.
> I am developing a multi-threaded database application where a user can
> execute what ever SQL statement in a secondary thread. When the user
> wishes to cancel, the main thread issues the cancel by calling the
> DB-Library command:
>  dbCancel();

> However, as soon as I call this function, I get a run time assertion
> below:
> -------------------
> Program: MyThreadedApp.exe
> File: q:\SPHINX\NETLIBS\nt\ssock\src\ntssockc.c
> Line: 597

> Expression: 1 == pConnectionObject->fCallCheck
> -------------------------

Well, it's nothing you must understand. It is obviously a bug somewhere
on the line. Judging from the path in the message, in the net library.
Then again, had the assertion error fired, it is possible that you would
have got an error code in return.

What you could try is to change network library. That is if you use named
pipes, switch to TCP/IP or multiprotocol. You can do this in the Client
Network Utility.

There is also a more drastic change you probably should consider, how
much I hate to say this... Microsoft is no longer developing DB-Library,
and with DB-lib you cannot use the new datatypes added in SQL7 and later.
Furthermore, Microsoft has announced that next version of SQL Server
will only contain run-time for DB-Library, but no include files or link
libraries. Even later versions of SQL Server may drop support for DB-
Library.

--
Erland Sommarskog, SQL Server MVP

Books Online (updated!) for SQL 2000 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 
 
 

DB Library error or assertion when cancelling a long running procedure

Post by Larry Chesnut [M » Fri, 17 May 2002 07:35:50


Is the application a multi threaded application?  This assertion will fire
if you are sharing a conneciton across threads without serializing access
to the connection.  Because you cannot share connections between threads,
you should open different connections for each thread.

This posting is provided "AS IS" with no warranties, and confers no rights.
When posting, please state the version of SQL Server being used and the
error number/exact error message text received, if any.

Are you secure?  For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

 
 
 

1. Cancelling a long running query

I am trying to allow user to cancel a long running query that populates a
grid. When the cancel button is pressed, it will check recordset.state, and
if it is equal to adStateExecuting, then it calls Recordset.Cancel method.

Unfortunately, Cancel method takes just as long as the recordset.open
method - which was originally the reason behind my rationale for
implementing a cancel mechanism.

Any idea what is wrong?

I have opened the recordset using adAsyncExecute option.

By the way, when does FetchProgress event of recordset gets called? Does
FetchComplete event fire when recordset.open method returns?

Thanks in advance

2. db2 CLI stopped working/How to reset permissions?

3. DB-Library error 10040: DB-Library network communication layer not loaded

4. SQL connection with office xp developer

5. Assertion Failed Error with SYB 11 Client Libraries

6. Refreshing input fields in FoxPro

7. Microsoft Visual C++ Run time library Run time error R6025

8. Q: DB-library - dbrpcparam cannot pass long varchar

9. DB-Library error Net_Lib error : -1

10. DB Library Error/Network Error 10054 v6.0 sp3

11. CONNECTIVITY ERROR: DB-Library error?