ITEC 3220 Lecture Notes - Lecture 1: System Resource, Two-Phase Locking, Microsoft Powerpoint

22 views4 pages
Ambassador badge icon
13 Dec 2021
Course
Professor

Document Summary

We have two types of lock shared lock and exclusive lock, these locks are on objects. Transaction first locks the object to read it. If object is not locked shared or exclusive lock can grant it. R(a) -> before reading, it checks if its whether unlocked, shared and exclusive. If its exclusive and belongs to another transaction, lock not granted. If its locked by shared lock, transaction either must wait or get another shared lock. Database level, table level, page level, row level and field level. If t reads an object it first requests a shared lock on the object. If t writes an object it first requests an exclusive lock on the object. All locks held by transaction are released . To read an object t requests shared lock to write t request exclusive lock. A transaction cannot request additional locks once it releases any lock". No data are affected until all locks are obtained.