Automating Locking
2PL can be hidden from the application
When a data manager gets a Read or Write operation from a transaction, it sets a read or write lock.
How does the data manager know it’s safe to release locks (and be two-phase)?
Ordinarily, the data manager holds a transaction’s locks until it commits or aborts. A data manager
- can release read locks after it receives commit
- releases write locks only after processing commit,to ensure strictness