Multiple Granularity Locking - Lock Modes

Lock Modes

In addition to shared (S) locks and exclusive (X) locks from other locking schemes, like strict two-phase locking, MGL also uses intention shared and intention exclusive 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 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).

Determining what level of granularity to use for locking is done by locking the finest level possible (at the lowest leaf level), and then escalating these locks to higher levels in the file hierarchy to cover more records or file elements as needed. This process is known as Lock Escalation. MGL locking modes are compatible with each other as defined in the following matrix.

Mode NL IS IX S SIX X
NL Yes Yes Yes Yes Yes Yes
IS Yes Yes Yes Yes Yes No
IX Yes Yes Yes No No No
S Yes Yes No Yes No No
SIX Yes Yes No No No No
X Yes No No No No No

Read more about this topic:  Multiple Granularity Locking

Famous quotes containing the words lock and/or modes:

    then take off your flesh,
    unpick the lock of your bones.
    In other words
    take off the wall
    that separates you from God.
    Anne Sexton (1928–1974)

    Sight and all the other senses are only modes of touch.
    Samuel Butler (1835–1902)