Isolation Levels Flashcards
What are the isolation levels in t-sql?
Read Uncommitted Read Committed Repeatable Read Serializable Snapshot
What is the default isolation level for SQL?
Read Committed
Read Uncommitted - dirty read?
Yes
Read Uncommitted - Non Repeatable Read
Yes
Read Uncommitted - Phantom Read?
Yes
What is a Dirty Read?
When one transaction is permitted to read another that is changing data but has not committed yet.
What is a Non Repeatable Read?
Data read twice inside the same transaction cannot be guaranteed to contain the same value.
What is a Phantom Read?
In the course of a transaction, new rows are added or removed by another transaction to the records being read.
Read Committed - Dirty Read?
No
Read Committed - Non Repeatable Read
Yes
Read Committed - Phantom
Yes
Repeatable read - Dirty Read
No
Repeatable read - Non Repeatable Read
No
Repeatable read - Phantom
Yes
Snapshot - Dirty Read
No
Snapshot - Non Repeatable Read
No
Snapshot - Phantom
No
Serializable - Dirty Read
No
Serializable - Non Repeatable Read
No
Serializable - Phantom
No
What are the Lock modes?
Exclusive Lock (X) Shared Lock (S) Update Lock (U) Intent Lock (I)
What are the Regular Intent Locks?
Intent Exclusive (IX) Intent Shared (IS) Intent Update (IU)
What are the Conversion Locks?
Shared With Intent Exclusive (SIX)
Shared with Intent Update (SIU)
Update with Intent Exclusive (UIX)
Bulk Update Locks (BU)
What is the Locking Hierarchy?
DATABASE -> TABLE -> PAGE -> ROW