concurrencydirectory (including the classes that you are not touching - they may contain useful methods or information pertinent to the project). Many comments contain critical information on how you must implement certain functions.
LockManagerobject manages all the locks, treating each resource as independent (it doesn't consider the resource hierarchy at all). This level is responsible queuing logic, blocking/unblocking transactions as necessary, and is the single source of authority on whether a transaction has a certain lock. If the
LockManagersays T1 has X(database), then T1 has X(database).
LockContextobjects, which each represent a single lockable object (e.g. a page or a table) lies on top of the
LockContextobjects are connected according to the hierarchy (e.g. a
LockContextfor a table has the database context as its parent, and its pages' contexts as children). The
LockContextobjects all share a single
LockManager, and each context enforces multigranularity constraints on its methods (e.g. an exception will be thrown if a transaction attempts to request X(table) without IX(database)).
LockContextobjects, and is responsible for acquiring all the intent locks needed for each S or X request that the database uses (e.g. if S(page) is requested, this layer would be responsible for requesting IS(database), IS(table) if necessary).
LockManager) and lock types. In Part 2, you will be implementing the middle and top layer (
LockUtil), and integrate your changes into the database.