ALLBASE/SQL Reference Manual (36216-90216)
Chapter 5 181
Concurrency Control through Locks and Isolation Levels
What Determines Lock Types
page. Note that S and X locks on the same page are not compatible.
When locks are not compatible, the second access request must wait until the lock acquired
by the first access request is released.
Weak Locks
Intention exclusive locks are called weak locks when there is no other lock at a finer level
of granularity on the object being locked. This is the case for index pages, which are locked
IX when concurrent transactions are updating different rows on the same page. Weak
locks, also known as sublocks or concurrent locks, are used to prevent the deletion of an
index page by another concurrent transaction. ALLBASE/SQL uses strong locks (exclusive
locks) on index pages only for splitting, deleting, or compressing index pages.
What Determines Lock Types
ALLBASE/SQL locks one or more of the following three objects:
• Tables. Rows or pages of tables or entire tables are locked when you execute SQL
statements referencing them.
• PCRs. Pages of PCRs (indexes that support referential constraints) are locked when
ALLBASE/SQL updates a key value.
• Indexes. Pages of indexes are locked when ALLBASE/SQL updates an index.
• System tables. Rows or pages in one or more system tables are locked when you
execute any SQL statement. System tables are always locked at the RR level regardless
of the transaction isolation level, when they are accessed for execution of an SQL
statement. Refer to the appendix "Locks Held on the System Catalog by SQL
Statements" in the ALLBASE/SQL Database Administration Guide for complete
information.
As this summary indicates, locks on
user
data and indexes are obtained at the row level,
page level, or at the table level. Although some locking of
system
data is done at the row
level, system catalog indexes are
always
locked at the page level.
The locks that are applied to pages and tables are determined by a combination of the
following factors: