- Transaction ID =
the identifier of the
transaction that
made the
lock request
- Lock mode =
the mode (type of lock) of the
lock requested
(e.g.: shared,
update,
exclusive, etc.)
- S (shared) =
transaction has
requested a shared lock on
the database element
- U (update/upgrade) =
transaction has
requested a update lock on
the database element
- X (exclusive) =
transaction has
requested a exclusive lock on
the database element
|
- Wait? =
status of the
lock request
- Next =
used to construct a
linked list of
all lock requests
for the same
database element
Example usage:
- Tnext =
a linking field used to
chain all the lock requests
made by the
same transaction
- A transaction T makes
multiple lock requests
- The Tnext field is used to
link
all requests made by
the same transaction
together
|
How is the
Tnext field used:
Suppose a
transaction T1 locks
2 database elements
A and B:
Why do we
need this
data structure:
- When a transaction
completes (commit/abort), the
transaction manager must:
- Release
all locks held
by the transaction !!!
|
- The list of
locks held by
a transaction can
be used to:
- Find
all locks held
by the transaction
quickly !!!
|
|
|