In addition to shared (
S) locks and exclusive (
X) locks from other locking schemes, like strict two-phase locking, MGL also uses intentional "locks", which do not directly lock a node, but instead denote the existence, or intent to add, a lock of the specified type lower in the node hierarchy. Intentional locks include "intention shared" (
IS), "intention exclusive" (
IX), and the combined "shared and intention exclusive" (
SIX) locks.
IS locks conflict with
X locks, while
IX locks conflict with
S and
X locks. The null lock (
NL) is compatible with everything. To lock a node in
S (or
X), MGL has the transaction lock on all of its ancestors with
IS (or
IX), so if a transaction locks a node in
S (or
X), no other transaction can access its ancestors in
X (or
S and
X). This protocol is shown in the following table: Determining what level of granularity to use for locking is done by locking the finest level possible (i.e., at the lowest leaf), and then escalating these locks to higher levels in the file hierarchy to cover more records or file elements as needed in a process known as "lock escalation". MGL locking modes are compatible with each other as defined in the following matrix. Following the locking protocol and the compatibility matrix, if one
transaction holds a node in S mode, no other transactions can have locked any ancestor in X mode. ==See also==