|< < 22 > >|

Strict Two-Phase Locking

Lock implementation

Lock Manager API

lock(transaction, object, lock_mode)

  • transaction: The process's current transaction.
  • object: The thing to be locked.
  • lock_mode: shared or exclusive.

Possibilities:

  • Lock is granted: The lock may be granted immediately, if the object is not currently locked; or after a delay, in case the object is already locked.

  • Block: Don't return until the lock is granted.

  • Exception thrown:
    • Concurrency conflict requires the requesting transaction to be aborted.
    • Deadlock requires the requesting transaction to be aborted.

|< < 22 > >|