The KEEP CURRENT statement places an explicit shared or exclusive lock on a record that is current of run unit, record, set, or area. Locks placed on records through the KEEP CURRENT function are maintained for the duration of the database transaction or until explicitly released by means of the COMMIT or FINISH statements.
►►─── KEEP ─┬─────────────┬─ CURRENT ─┬────────────────────────┬─ ; ──────────►◄ └─ EXCLUSIVE ─┘ ├─ RECORD (record-name) ─┤ ├─ SET (set-name) ───────┤ └─ AREA (area-name) ─────┘
Specifies to place an exclusive lock on the current record of run unit, record, set, or area. If you do not specify EXCLUSIVE, the record receives a shared lock by default.
Specifies to place the lock on the current record of the named record type, set, or area.
The following example places an exclusive lock on the current EMPLOYEE record occurrence:
KEEP EXCLUSIVE CURRENT RECORD (EMPLOYEE);
Upon completion of the KEEP function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:
The request has been serviced successfully.
Currency has not been established for the named record, set, or area.
Either the named record or set is not in the subschema or the current record of run unit is not a member of the named set.
The program's subschema specifies an access restriction that prohibits execution of the KEEP function.
The named area is not in the subschema.
The record to be kept has been erased.
Deadlock occurred during locking of target record.
|
Copyright © 2014 CA.
All rights reserved.
|
|