"Ask Forgiveness, Not Permission"
Let transactions run freely, then check for conflicts at the end. Like taking an open-book exam and checking answers later.
Three Phases
1. Read Phase:
-
Read data normally
-
Store writes in local variables (don't update database yet)
2. Validation Phase:
-
Check if transaction conflicts with others
-
If conflicts found → ABORT
3. Write Phase:
-
If validation passed → Apply writes to database
-
Read-only transactions skip this phase
Validation Test
For transaction Ti with earlier transaction Tk:
Option 1: Tk finished before Ti started
- No overlap = No conflict
Option 2: Tk's writes don't affect Ti's reads
- Even if overlapped, no actual conflict
Example:
T25: Start=1, Validation=8, Finish=10
T26: Start=5, Validation=12, Finish=15
Check: Did T25 finish (10) before T26 started (5)?
Answer: No, so check option 2...
When to Use:
-
✅ Mostly read-only workloads
-
✅ Low conflict probability
-
❌ High conflict rate (many rollbacks)