ALLBASE/SQL Reference Manual (36216-90216)

Chapter 5 185
Concurrency Control through Locks and Isolation Levels
What Determines Lock Types
minimize the chance of deadlocks.
The kind of lock obtained at different isolation levels depends on the other factors that
determine locks--scan type, kind of SQL statement, and implicit table type. A simpliļ¬ed
summary of locks obtained on PUBLIC tables and their indexes appears in Table 5-3.. Hash
and TID scans are omitted.
Table 5-3. Locks Obtained on PUBLIC Tables with Different Isolation Levels
Isolation Level and
Scan Type
Read Operations
(SELECT, FETCH)
Read for Update
a
a. Opening a cursor that was declared FOR UPDATE (RR and CS), or using REFETCH
(RC and RU).
Write Operations
(UPDATE, INSERT,
DELETE)
Table Page Table Page Table Page
RR Sequential S - SIX - SIX X
RR Index IS S IX SIX IX X
CS Sequential IS
S
b
b. Lock released at the end of the next read.
IX SIX IX X
CS Index IS S IX SIX IX X
RC Sequential IS
S
c
c. Lock released at the end of the current read.
IX SIX IX X
RC Index IS S IX SIX IX X
RU Sequential None None IX SIX IX X
RU Index None None IX SIX IX X