Subject RE: [IBO] Bug? TIB_Query.locate - AbortFetching failing
Author G. Nau
Jason,
I just downloaded 4.8.5. and tried it with my bug demo application: Error is still there! Locate
operation is never returing when the fetching operation is canceled.

I tried to locate the place, where the endless loop occurs when the fetching operation is
canceled.
It's in ib_components, lin 35043, function TIB_BDataset.LookupKeyForFields: boolean;
in this code snipped:
if tmpCurLevel = FKeyLookupMaxLevel then
if not SysLookupKeyForFields then
FKeyLookupRef.Pos := InvalidNodePos;

The SysLookupKeyForFields function is looping (or at least: never returning).

Within this function it is trapped in this loop part:

while ( not Assigned( FKeyLookupRef.Node )) and
( not Result ) and
( not CursorEof ) and
( FAGen = FetchingAbortedGen ) and
( curCursorGen = FCursorGen ) do
begin
Inc( tmpRow );
SysFetchNext;
if tmpCurLevel = FKeyLookupMaxLevel then
begin
if tmpRow <> CursorRowNum then
// Somehow (via callbacks) there were additional fetches
// performed that did not pass through the code below to check
// for a match. So, by checking the nodelist we see if the
// match slipped by.
SysLookupNodeList *************** here the process is jumping back to the WHILE
statement

It's hard for me to follow the operations IBO is doing here. If that is of any help I can slim
down my own database to the table my bug sample app is using and send it by email.

Regards
Gunther

Am 4 Aug 2007 um 15:57 hat Jason Wharton geschrieben:

> Gunther,
>
> > See this file "tib_query.locate-cancel_on_fetching_bug.ZIP"
> > in the group Files > Bug Testing Applications.
> > A readme.txt is included about the usage and the mods
> > necessary to use it
> > with one of your own databases. You just need a database with
> > >20k rows,
> > so the data fetching form is appearing and the cancel button
> > can be clicked.
>
> I observed a slightly different situation which is more than likely due to
> your sample requiring me to use my own database and query. However, I
> examined the code for processing of Locate() requests and found that I
> needed to include a block of
>
> BeginCallbackFetching;
> try
> (do a bunch of fetches while locating...}
> finally
> EndCallbackFetching;
> end;
>
> around the code that does the fetching.
>
> Having it higher up will be more protective and do more to avoid a failure
> to break out of the loop.
>
> What I observed was simple that IBO didn't even go into fetch callback mode
> at all.
>
> Anyway, you just caught me at the tail end of getting IBO 4.8.5 out the
> door. The little small fix will be included in it.
>
> Thanks,
> Jason Wharton
> www.ibobjects.com
>
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>