Subject Re: [IB-Architect] Isolation level implemetation
Author Ivan Prenosil
> >What does it mean run as "pre-committed", how can I start a transaction that
> >don't affect the OAT in Interbase 6?
> I think the mechanism was not turned on for user transactions,
> but the garbage collect thread runs in that mode to avoid tying
> up the OAT. An ordinary snapshot reader must be recorded as
> active to preserve its view of the database. A read-committed
> transaction doesn't care about consistency - whatever is committed
> at the instant is OK - read the same record four times, see
> four version - hey, cool. So there's no reason to hold old
> versions around for read committed transactions.
> The implementation, if I remember, is to set the transaction state
> to committed on the TIP at start-up time. Works fine for readers,
> but it would not do at all for writers.

The comment is source code ("jrd/tra.c") says:

/* If the transaction is read-only and read committed, it can be
precommitted because it can't modify any records and doesn't
need a snapshot preserved. This is being enabled for internal
transactions used by the sweeper threads. This transaction type
can run forever without impacting garbage collection or causing
transaction bitmap growth. It can be turned on for external use
by removing the test for TDBB_sweeper. */

if (tdbb->tdbb_flags & TDBB_sweeper &&
trans->tra_flags & TRA_readonly &&
trans->tra_flags & TRA_read_committed)

So is it safe to remove test for TDBB_sweeper ?