
5.20 Describe the share and intent exclusive (six) lock mode type
NOTE: the shading on this picture may not be accurate. Please click on
the picture to obtain a larger image, which is accurate.
Key points
- A share and intent exclusive lock (or SIX lock, pronounced as the separate
letters S I X rather than like the number six)
indicates an S lock at the
current level plus an intention to write data at a lower level of
granularity. Think of an SIX lock as an S lock plus an IX lock. Only one
transaction can be granted an SIX lock on a table at a time.
- An SIX lock on a PUBLICROW table indicates an intention to read all of the
rows in the table and to write to a few. Rows that are read but not updated
will not obtain S locks (the S lock in the SIX lock at the table level
covers all of the rows). Rows that are updated will obtain X locks, but only
after IX intention locks have been obtained on the pages that contain them.
- An SIX lock on a PUBLIC table indicates an intention to read all of the pages
in the table and to write to a few. Pages that are read but not updated will
not obtain S locks. Pages that are updated will obtain X locks.
- Occasionally, an SIX lock is acquired on a row of a PUBLICROW table, or on a
page of a PUBLIC table. This occurs when the transaction has read the row or
page with the intention of writing to it later. An SIX lock on a row or page
must be converted to an X lock before the actual update may occur. No other
transaction can read or modify a row or page that has been locked with an
SIX lock.
- An SIX lock is stronger than an S lock or an IX lock. When a transaction
obtains an SIX lock on a table, only that transaction will be able to modify
data in the table. In this respect, an SIX lock slightly resembles an X lock.
With an SIX lock, however, other transactions that want to read some of
the data (read data at the row or page level and obtain an IS
lock on the table) are allowed to proceed, so concurrency is better than with
an X lock. Lock mode compatibility will be described in greater detail later
in this module.
- If other transactions obtain S row locks in a PUBLICROW table or S page locks
in a PUBLIC table on rows that the SIX transaction wants to modify, the
SIX transaction must wait until the S locks are released before it can
modify the data.
- Other transactions that want to read all of the data
(obtain an S lock on the table) or that want to write to any portion of the
data are not allowed to proceed until the SIX lock is released.
- An SIX lock is also called a share subexclusive lock.

Page last updated on November 29, 1995
|