Firebird/Windows/AMD/Intel/x64 (access method), version "WI-V3.0.7.33374 Firebird 3.0"
ServerMode: Super
Operating System: Windows 10 10.0.19042
I'm experimenting with transactions and found that the documentation of the isolation level 'snapshot table stability' doesn't match the behaviour I experienced. The documentation states that:
If any other transaction has an uncommitted change of data pending in any database table before a transaction with the SNAPSHOT TABLE STABILITY isolation level is started, trying to start a SNAPSHOT TABLE STABILITY transaction will result in an exception.
To test this, I started two isql instances and connected to the same database. Then I started a default transaction (read write wait isolation level stability) and began to update rows of a table and kept the transaction running, i.e. no commit, no rollback.
In the other isql instance I started a snapshot table stability transaction like this:
set transaction snapshot table stability;
select current_transaction from rdb$database;
The transaction immediately started, even though another transaction has pending changes, which contradicts the documentation?
I experienced the following behaviour of a transaction with snapshot table stability isolation level:
Once a snapshot table stability transaction T has read at least one row of a table, any other transaction trying to update this table in the meantime will block/wait/timeout. If a database table hasn't been read by T yet, other transactions can still update, insert, delete data in these non-read tables. If T however tries to read this changed tables it will block/wait until the changes have been committed or rolled back. Why does it need to block in this case? T is not able/intended to see committed changes since it started. After the other transaction committed/rolled back, T continues with the old data anyway.
Do I misunderstand here something or is the documentation misleading/wrong?