What are the types of record locks? How to set them? - IDMS

What are the types of record locks? How to set them?



- There are 2 locks that are supported by IDMS.

Shared Lock:

- Other run units can retrieve the record.

- Data / record can not be modified.

Exclusive Lock:

- Other run units can retrieve the record or modify the record.

- Only one operation can be done.

- Records locks may be implicit or explicit.

- Implicit locks are applied with ready statement usage clause.

- Explicit locks are applied using the ‘keep’ statement or keep option of ‘find’ command.
Post your comment

    Discussion

  • RE: What are the types of record locks? How to set them? - IDMS -AL DIOVANNI (10/11/15)
  • READYing the Database Areas:

    After binding the run unit and database records and before issuing any DML Functional Command, all database areas to be accessed must be readied. This can be accomplished in two (2) ways:

    1. By READY statements coded in the program
    2. By default READY specifications which are coded in the program’s SUBSCHEMA. In this case, the program need not issue any READY statements. However, if a program issues a READY statement for one area, it must explicitly READY all areas to be accessed.

    The READY statement prepares a Database Area for access by DML Functional Commands and specifies how that area can be used by this RUN-UNIT and by other RUN-UNITS via the USAGE MODE clause.

    The USAGE MODE clause functions as follows:

    A READY statement that does not specify a usage mode readies the specified area(s) in SHARED RETRIEVAL Mode.

    A READY statement that does not name an area readies ALL AREAS in the program’s SUBSCHEMA in the specified usage mode.

    A READY statement that specifies neither an area nor a usage mode readies ALL AREAS in the SUBSCHEMA in Shared RETRIEVAL Mode.

    READY Statement Format: READY [AREA-NAME] USAGE-MODE IS [SHARED] {RETRIEVAL}
    [EXCLUSIVE] {UPDATE}
    [PROTECTED]

    Legend: SHARED/EXCLUSIVE/PROTECTED are READY Options; RETRIEVAL/UPDATE are USAGE Modes.

    READY OPTIONS specify how other run units executing concurrently under the source CV can use the area:

    SHARED – Other RUN-UNITS can READY the area for concurrent access and/or update. SHARED is the default if READY OPTION is not supplied.

    EXCLUSIVE – No other RUN-UNIT can READY the area until this RUN-UNIT is finished with it (applies only when running under CV).

    PROTECTED – No other RUN-UNIT can READY the area in UPDATE Mode until this RUN-UNIT is finished with it (applies only when running under CV).

    USAGE MODES specify how this RUN-UNIT will use the area:

    RETRIEVAL Usage Mode – Only those DML Functional Commands that do not alter the database in any way are permitted. RETRIEVAL is the default if USAGE MODE is not supplied.

    UPDATE Usage Mode – All DML Functional Commands are permitted.