Subject RE: [firebird-support] READ ONLY READ COMMITTED and consistency
Author Alan McDonald
> In a transaction configured with READ ONLY READ COMMITTED, is it
> possible to see just part of a commit?
>
> Imagine a rather long-running SELECT and an intervening UPDATE changing
> two rows which will both be part of our SELECT's result set:
>
> SET TRANSACTION READ ONLY READ COMMITTED;
> SELECT a FROM MyTable WHERE <going to take a while>;
>
> While the SELECT is fetching data, in another transaction:
>
> UPDATE MyTable SET a = :x WHERE <lightning-fast index lookup>;
> -- affecting two rows in MyTable
> COMMIT;
>
> My SELECT is still running and fetching data at this point.
>
> Is it possible for my RO/RC transaction to see one of the two rows
> affected by the intervening UPDATE in its state before the intervening
> COMMIT, and the other in its state after that COMMIT?

No - you select transaction is started before the update and will only see
data committed to that point. It will never see the updated from a
subsequent update until it commits and re-reads
Alan

>
> This would not, if I understand correctly, constitute a DIRTY READ
> (which Firebird does not allow), as both versions are committed, just
> not by the same transaction.

Subsequent commits are not visible


>
> It might nevertheless be undesirable.
> --
> Michael Ludwig