Subject RE: [IBO] Bug - TIBOQuery opens again when manually committed
Author Paul Hope
Hi Woody

> From: "Paul Hope" <paulhope@...>
> > the query is connected to a TIB_connection and a
> TIB_Transaction (no
> > autocommit). I also have a TIB_Query (q) with default transaction
> > just for reading the generator value and a TMemo for
> displaying these.
> >
> > I run the code
> >
> > procedure TForm1.Button1Click(Sender: TObject); begin
> > memo1.lines.add('before '+intToStr(q.Gen_ID('inv_no',0)));
> > ib_transaction1.StartTransaction;
> > iboquery1.Close;
> > iboquery1.Open;
> > memo1.lines.add('after open '+intToStr(q.Gen_ID('inv_no',0)));
> > ib_transaction1.Commit;
> > memo1.lines.add('after commit '+intToStr(q.Gen_ID('inv_no',0)));
> > end;
>
> Just a guess, but you are accessing the query field after
> it's been closed.
> Internally, the TIB_Query may be reopening for some reason
> because of this.
> What is the state of the query component after the last time
> you access it after you do the commit? Is it showing closed or open?
>
> Woody (TMW)

I havent shown any access to it (iboquery1) here, just close and open plus
the transaction start and commit. In my real app I access it after open and
before commit. Don't forget that 'q' is not connected to the transaction
and only reads the generator also the problem doesn't occur if I change the
TIBOQuery to a TIB_Query.

Regards
Paul