Subject Re: Transaction Info
Author Adam
> A few questions regarding transactions:
>
> 1. Is it possible to get the transaction number in a trigger ?

With Firebird 1.5 or higher,

CURRENT_TRANSACTION

> 2. Are the transaction numbers assigned in an increasing sequence ?
>

Yes and no. Yes they are assigned in increasing sequences, but they
reset to 0 if you restore, so if the next transaction is 100, and you
back it up and restore it, it goes back to 1.

> 3. gstat gives information about the oldest transaction and oldest
> active. What is the difference between the two ? Is it possible to
> obtain this information using any firebird API ?
>

I forget this myself. The difference between the two is bad if it is
too large. Ideally, they should remain pretty close. If the gap is too
big, then old record versions will start clogging up the database with
garbage. The normal culprits are commit retaining and rollback
retaining, which do not release the context and so do not help the
garbage collection.

Some light reading ;)
http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_expert4

I don't know if it is possible through the API.

Adam