Subject Re: [IBO] In multiuser system
Author freeadmin
Dear Helen,

Thank you very much for your prompt reply.
The information you gave me were clear for me.
Maybe my bad (not so good) English caused misunderstanding.
I try to put the questions once again:

1. Under the settings and events (you can find below)
is the call of StartTran event necessary?
2. Below you can find a commented area in the AfterPost and
AfterCancel events of the master Query. I set in two different
solutions into the following part of code (one is in the
commented area, the other one is outside of the commented area).
Please let me know which solution is better?


Settings:

AutoCommit := false

procedure TForm1.FormCreate(Sender: TObject);
begin
IB_Query1.Open; { Master }
... { Details }
IB_Queryn.Open; { -||- }
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
IB_Query1.Close;
...
IB_Queryn.Close;
end;

{
Part of dfm file:
object IB_Query1: TIB_Query
...
BeforeDelete = StartTran
BeforeEdit = StartTran
BeforeInsert = StartTran
...
end
}

procedure TfrmFriss.StartTran(IB_Dataset: TIB_Dataset);
begin
with IB_Dataset.IB_Transaction do
if not InTransaction then
StartTransaction;
end;

procedure TfrmFriss.IB_Query1AfterPost(IB_Dataset: TIB_Dataset);
begin
with IB_Dataset.IB_Transaction do
if Started or InTransaction or TransactionIsActive then
Refresh( true ); { or CommitRetaining; }
end;

procedure TfrmFriss.IB_Query1AfterCancel(IB_Dataset: TIB_Dataset);
begin
with IB_Dataset.IB_Transaction do
if Started or InTransaction or TransactionIsActive then
Refresh( false );

{ or begin
RollbackRetaining;
// If the ( TimeActive > ( TimeoutProps.AllowCheckOAT / 88400 ))
// is valid, the Started property will be false.
if not Started then IB_Dataset.CheckTransaction( true );
end; }
end;


Thank you very much for your kind help in advance.

Regards,
FreeAdmin