Comparing SNAPSHOT, READ COMMITTED, and SNAPSHOT TABLE STABILITY
Go Up to Isolation Level
There are five classic problems all transaction management statements must address:
- Lost updates, which can occur if an update is overwritten by a simultaneous transaction unaware of the last updates made by another transaction.
- Dirty reads, which can occur if the system allows one transaction to select uncommitted changes made by another transaction.
- Non-reproducible reads, which can occur if one transaction is allowed to update or delete rows that are repeatedly selected by another transaction.
READ COMMITTED
transactions permit non-reproducible reads by design, since they can see committed deletes made by other transactions. - Phantom rows, which can occur if one transaction is allowed to select some, but not all, new rows written by another transaction.
READ COMMITTED
transactions do not prevent phantom rows. - Update side effects, which can occur when row values are interdependent, and their dependencies are not adequately protected or enforced by locking, triggers, or integrity constraints. These conflicts occur when two or more simultaneous transactions randomly and repeatedly access and update the same data; such transactions are called interleaved transactions.
Except as noted, all three InterBase isolation levels control these problems. The following table summarizes how a transaction with a particular isolation level controls access to its data for other simultaneous transactions:
Problem | SNAPSHOT, READ COMMITTED
|
SNAPSHOT TABLE STABILITY
|
---|---|---|
Lost updates |
Other transactions cannot update rows already updated by this transaction. |
Other transactions cannot update tables controlled by this transaction. |
Dirty reads |
Other Other |
Other transactions cannot access tables updated by this transaction. |
Non-reproducible |
|
Other transactions cannot access tables updated by this transaction. |
Phantom rows |
|
Other transactions cannot access tables controlled by this transaction. |
Update side effects |
Other SNAPSHOT transactions can only read a previous version of a row updated by this transaction. Other Use triggers and integrity constraints to try to avoid any problems with interleaved transactions. |
Other transactions cannot update tables controlled by this transaction. Use triggers and integrity constraints to avoid any problems with interleaved transactions. |