Subject Re: [firebird-support] Transaction Info
Author Ann W. Harrison
kapsee wrote:
> 3. gstat gives information about the oldest transaction and oldest
> active. What is the difference between the two ?

The oldest transaction is the first transaction that did not commit - it
could be rolled back, in limbo, or active. That marks the beginning of
the "interesting" transactions - those which could require special
handling. The database maintains an array in memory of the interesting
transaction states - two bits per transaction. If the array is very
large, you're wasting some memory.

The way to move the oldest transaction is to sweep the database with
gfix. It removes any records created by transactions that rolled back
and marks the transactions as committed.

The oldest active transaction is the oldest transaction that was
running at the start of the oldest transaction currently running.
Nothing created by a newer transaction can be garbage collected, so
cruft builds up when the oldest active is much below the next

> Is it possible to
> obtain this information using any firebird API ?

Yes. Use the database info call.

isc_info_oldest_transaction = 104,
isc_info_oldest_active = 105,
isc_info_oldest_snapshot = 106,
isc_info_next_transaction = 107,