Concurrency Problems
1. Dirty Read
Reading uncommitted changes from another transaction:
Learning Objectives
Lesson Outline
Reading uncommitted changes from another transaction:
Same query returns different results:
New rows appear between reads:
| Level | Dirty Read | Non-Repeatable | Phantom |
|---|---|---|---|
| Read Uncommitted | ✓ Possible | ✓ Possible | ✓ Possible |
| Read Committed | ✗ Prevented | ✓ Possible | ✓ Possible |
| Repeatable Read | ✗ Prevented | ✗ Prevented | ✓ Possible |
| Serializable | ✗ Prevented | ✗ Prevented | ✗ Prevented |
Higher isolation = More correct but slower
Lower isolation = Faster but may have anomalies