Table Locks

 <  Day Day Up  >  

DB2 can use table locks only when segmented table spaces are involved in the process. Table locks are always associated with a corresponding table space lock.

The same types of locks are used for table locks as are used for table space locks. S , U , X , IS , IX , and SIX table locks can be acquired by DB2 processes when data in segmented table spaces is accessed. Table 23.1 describes the options available to DB2 for table locking. The compatibility chart in Table 23.3 applies to table locks as well as table space locks.

For a table lock to be acquired, an IS -lock must first be acquired on the segmented table space in which the table exists. The type of table lock to be taken depends on the LOCKSIZE specified in the DDL, the bind parameters chosen for the plan being run, and the type of processing requested . Table 23.4 is a modified version of Table 23.2, showing the initial types of table spaces and table locks acquired given a certain set of conditions. Table locks are not acquired when the LOCKSIZE TABLESPACE parameter is used.

Table 23.4. How Table Locks Are Acquired

Type of Processing

LOCKSIZE

Isolation

Table Space Lock Acquired

Table Lock Acquired

MODIFY

ANY

CS

IS

IX

MODIFY

PAGE

CS

IS

IX

MODIFY

TABLE

CS

IS

X

MODIFY

ANY

RR

IS

X

MODIFY

PAGE

RR

IS

X

MODIFY

TABLE

RR

IS

X

SELECT

ANY

CS

IS

IS

SELECT

PAGE

CS

IS

IS

SELECT

TABLE

CS

IS

S

SELECT

ANY

RR

IS

S

SELECT

PAGE

RR

IS

S

SELECT

TABLE

RR

IS

S


 <  Day Day Up  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net