Subject Re: [firebird-support] Transaction number discrepancy
Author Vlad Khorsun
> In order to try and track stuck programs/transactions I have started
> to include a small timer routine that is intended to identify and
> record the oldest transaction used by a program every few minutes.
>
> procedure TfMRP.Timer3Timer(Sender: TObject);
> var
> i,t,j : integer;
> tstr,s : string;
> tTrans: TIBTransaction;
> tsql : TIBQuery;
> begin
> t := 0;
> tstr := '';
> for i := 0 to Database.ComponentCount -1 do
> if Database.Components[i].ClassType = TIBTransaction then
> begin
> try
> tTrans := TIBTransaction(LoaderData.Components[i]);
> if tTrans.Intransaction then
> begin
> j := tTrans.TransactionID;
> if (t = 0) or (t > j) then
> begin
> t := j;
> tstr := tTrans.Name;
> end;
> end;
> except
> end;
> end;
> etc - where Database is the Delphi form with all my database components.
>
> If I use IBExpert (or another program) to get the header page
> statistics from firebird (v2.0.0.12748) I can compare the lowest
> transaction on each program with the oldest active transaction
> reported by the database.
>
> Unfortunately the above program gives me transaction ID's which are
> lower (older) that any of the numbers reported by the database in its
> header page.

When do you see at header page ? Is it possible that you look
at header page after your transactions ends ?

Regards,
Vlad