Purpose of Record Locks
Record locks are used within the central version to control concurrent access to individual record occurrences (rows). Occurrence-level record locks (in conjunction with area locks) are used to:
Implicit record locks
CA IDMS/DB automatically places locks on records accessed by a transaction if the area in which the record resides is readied in any of the following modes:
|
Area ready mode |
Record lock |
|---|---|
|
Shared retrieval on read records |
Shared (S) locks |
|
Shared update |
Shared (S) locks on read records; exclusive (X) locks on updated records |
|
Protected update |
Exclusive (X) locks on updated records |
Note: You can use system generation options to inhibit record locking for navigational DML applications, as discussed in 39.4.6, “System Generation Options Affecting Record Locking".
Shared Record Locks
If shared locks are being maintained, CA IDMS/DB places one on each record as it is accessed. Shared locks are also maintained on:
Note: Additional shared locks are maintained on the current row of each updatable cursor open within an SQL transaction.
CA IDMS/DB releases these locks as the transaction accesses different record occurrences. These implicit record locks guarantee the integrity of the currencies used by navigational DML applications and provide the protection necessary for SQL applications executing with an isolation level of cursor stability.
Note: For more information about isolation levels, see 39.2.4, "Ready Modes and SQL Access".
Exclusive Record Locks
If exclusive locks are being maintained, CA IDMS/DB places them on all records altered by a DML or DDL statement until the recovery unit terminates (that is a COMMIT (CONTINUE), ROLLBACK (CONTINUE) or FINISH is issued) or until the transaction abends.
Implicit Page Locks
Implicit locks are used in a special way to control user access to pages for which the amount of available space has been altered. When the available space on a page is changed as a result of an update operation, CA IDMS/DB places a special implicit exclusive lock on the page, allowing retrieval to continue. If a subsequent DML or DDL command from a different transaction requests further modification to available space on that page, the request is delayed until the lock is released (that is, until the recovery unit that caused the lock to be set terminates).
Explicit Record Locks
The navigational programmer can set explicit record locks with the DML KEEP command. The KEEP verb or the KEEP option of a FIND or OBTAIN verb places a shared lock on the record occurrence. KEEP with the EXCLUSIVE option places an exclusive lock on the record occurrence. CA IDMS/DB holds explicit record locks until the transaction terminates or a COMMIT ALL statement is executed.
|
Copyright © 2014 CA.
All rights reserved.
|
|