Breakexec during fetch does not generate any exception?

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Breakexec during fetch does not generate any exception?

Post by Ludek » Fri 01 Mar 2013 07:49

Hello,
I'm testing multithread capabilities of SDAC and currently found out, that calling breakexec during query execution time generates some EOLEDBError in executing thread (nice), but calling breakexec during fetch does not, just silently stops fetching. Why? The one thread, that is opening the query, should know, that the results are not complete and stop operation... Is there some option that would generate some exception in the thread, that opens such broken query?
Thanks, Ludek.

AndreyZ

Re: Breakexec during fetch does not generate any exception?

Post by AndreyZ » Fri 01 Mar 2013 10:39

Hello,

When you execute a query and then break it, SQL Server generates an error. When you fetch data and then break fetching, SQL Server does not generate any errors. That is why you do not get any error when you break fetching. We will investigate this question.
As a workaround, you can use a boolean variable indicating that fetching is not complete. Here is an example:

Code: Select all

MSQuery1.BreakExec;
FullyFetched := False;

Post Reply