Subject | [IBO] Bug - TIBOQuery opens again when manually committed |
---|---|
Author | Paul Hope |
Post date | 2007-05-29T14:04:48Z |
Hi
IBO version 4.7.16
I have an TIBOQuery with 'select * from test2'
test2 is a procedure that return a number from a generator - -
create procedure TEST2
returns (i integer)
as
begin
i=gen_id(inv_no,1);
suspend;
end
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;
I get the following results
before 291974
after open 291975
after commit 291976
commit causes the statement to execute again and increment the generator.
Also the IB_Monitor shows execute statement occurring twice.
If I change the TIBOQuery to a TIB_Query this doesnt happen.
Regards
Paul
[Non-text portions of this message have been removed]
IBO version 4.7.16
I have an TIBOQuery with 'select * from test2'
test2 is a procedure that return a number from a generator - -
create procedure TEST2
returns (i integer)
as
begin
i=gen_id(inv_no,1);
suspend;
end
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;
I get the following results
before 291974
after open 291975
after commit 291976
commit causes the statement to execute again and increment the generator.
Also the IB_Monitor shows execute statement occurring twice.
If I change the TIBOQuery to a TIB_Query this doesnt happen.
Regards
Paul
[Non-text portions of this message have been removed]