 |
» |
|
|
 |
 |
 |

5.28 Describe lock compatibility (continued)
Key points (continued)
- When referencing the chart, you may find it helpful to use the following:
- S -- indicates a transaction that wants to read all of the rows.
- X -- indicates a transaction that wants to write to all of the rows.
- IS -- indicates a transaction that wants to read some of the rows.
- IX -- indicates a transaction that wants to write to some of the
rows.
- SIX -- indicates a transaction that wants to read all of the rows,
and also write to some of them.
- Locks are compatible if a good chance exists that two transactions will not
interfere with each other. The chart on the opposite page shows the
compatibility of the lock mode types.
- An IS lock indicates an intention to read some of the rows. When an IS
lock has been granted, other users that want to read or write to some
of the rows (that is, obtain an IS or IX lock) are allowed to access the data
(ALLBASE/SQL assumes that the users may want to access
different rows). Other users that want to read all of the
rows (that is, obtain an S or SIX lock) are allowed. Users that want to write
to all of the rows (that is, obtain an X lock) would
interfere with the IS transaction, so they are not allowed.
- An IX lock indicates an intention to write to some of the rows. When an
IX lock has been granted, other users that want to read or write to some
of the rows (IS or IX lock) are allowed. Users that want to read or write to
all of the rows (S, SIX, or X lock) would interfere with the
IX transaction, so they are not allowed.
- An S lock indicates an intention to read all of the rows. When an S
lock has been granted, only other users that want to read data (either
some (IS lock) or all (S lock) of the rows) are allowed. Users
that want to write to any portion of the data (IX, SIX, or X lock) would
interfere with the S transaction, so they are not allowed.
- An X lock indicates an intention to write to all of the rows. When an
X lock has been granted, no other user is allowed. Users that want to access
any portion of the data would interfere with the X transaction.
- An SIX lock is equivalent to an S lock plus an IX lock. The only type of lock
that is compatible with both of these locks is an IS lock. When an SIX lock
has been granted, only those other users that want to read some of the
rows (IS lock) are allowed. Users that want to read all of the rows
(S or SIX lock) would interfere with the IX lock, and users that want to write
to any portion of the data (IX, SIX, or X lock) would interfere with the S
lock.

Page last updated on November 29, 1995
|
|
|