Transaction Isolation Level
Transaction Isolation Level
Controls transactions & behavior in SQL server . Everything happens in SQL Server in terms of
transactions.
DB locking
Concurrency, locking that occurs in DB , how locking can lead to blocking , how to troubleshoot
blocking issues.
Types of Locks:
Shared Locks
Exclusive Locks
Transaction Locks
DML Locks
Backup- Recovery Locks
Transactional Locking:
Relates to the ability of DBMS to ensure reliable transactions that adhere to ACID properties.
Transaction Isolation:
Read Uncommitted
Read Committed
Repeatable Read
Snapshot
Serializable
Read Uncommitted:
Read Committed:
Repeatable Read:
If we want the Read operations to be repeatable, we can choose this isolation level.
Issuing the same query twice within a transaction won’t pickup any changes to data values that
another user’s transaction has made.
No other user can modify the data that your transaction visits as long as you have not yet
committed or rolled back your transaction.
Snapshot:
Here, the transaction 2 will read only the data that has been the state of the data before the
transaction 1 started.
So, it will get the snapshot of the data before the transaction 1 started.
So, the transaction 2 can get the snapshot before any modifications done.
Serializable: