Subject Re: [IBO] "At end of Dataset" exception
Author Daniel Rail
Hi,

At May 31, 2005, 03:29, williamvdw2004 wrote:

> I am using ibo to do the following.

> Select first 100 * from messages where status = 1
> I open the query and iterate through the rows returned and I use a
> second query (same transaction connection and session) to update the
> status to 2

> FTransaction.StartTransaction;
> While not FQuery.Eof do
> begin
> ...
> update messages set status = 2 where ID = FQuery.Fieldbyname('ID')
> FQuery2.Execute;
> FQuery.Next;
> end;
> FTransaction.Commit;

> This is a multithreaded application but Connection, queries, sessions
> and transactions are NEVER shared among threads.

> I get the following exception... sometimes.

> "At end of Dataset"

> Is this excepion someting to worry about? At the moment I just catch
> the exception commit the work and move on.

Just looked in IBO's source and found that this exception is raised
when the dataset is unidirectional and when it passes the EOF. If the
query is only used to read data, then instead of using TIB_Query(or
TIBOQuery), use TIB_Cursor. Also, if your UPDATE statement is in a
TIB_Query(or TIBOQuery), then use TIB_DSQL for it. You probably will
see some improvement in performance. Also, I don't see if your actual
UPDATE statement uses parameters or not, but if it's not and it
doesn't change, then think of using parameters and prepare the
statement.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)