First page Back Continue Last page Summary Graphic
Updates (Contd.)
Protocol to avoid deadlock involving latches
- deadlocks involving latches and locks were a major problem in System R and SQL/DS
- transaction may hold at most two latches at-a-time
- must never wait for lock while holding latch
- if both are needed (e.g. Record found after latching page):
- release latch before requesting lock and then reacquire latch (and recheck conditions in case page has changed inbetween). Optimization: conditional lock request
- page latch released before updating indices
- data update and index update may be out of order
Notes: