Previous Topic: Area LocksNext Topic: Database Transactions


Area Usage Modes

Run units ready an individual area in a particular usage mode in order to define the scope of operations that can be performed against that area. The area usage modes, which are specified by the DML READY statement, are retrieval and update.

Retrieval

Retrieval specifies that the issuing run unit can perform only retrieval functions such as FIND, OBTAIN, and IF against records in that area. It cannot issue the STORE, MODIFY, ERASE, CONNECT, or DISCONNECT statements.

Update

Update specifies that the issuing run unit can modify as well as retrieve records in that area. That is, it can issue all available DML statements.

Ready Options

You can issue a ready option in conjunction with a usage mode to restrict retrieval or update of records in the specified area by other run units executing concurrently under the same central version. The ready options are:

The table below summarizes the effect that various combinations of usage modes and ready options have on concurrently executing run units.

The usage mode in which one run unit readies an area restricts the usage mode in which other run units executing under the same central version can ready that area. The following table shows in which usage modes two concurrent run units can ready an area. Y (yes) signifies that the second run unit can ready the area in the specified usage mode; N (no) signifies that it cannot.

                                         Run unit B
                   ┌────────────────────────────────────────────────────────────┐
                   │                                                            │
         ┌─────────┬───────┬─────────┬─────────┬──────────┬──────────┬──────────┐
         │         │SHARED │SHARED   │PROTECTED│PROTECTED │EXCLUSIVE │EXCLUSIVE │
         │         │UPDATE │RETRIEVAL│UPDATE   │RETRIEVAL │UPDATE    │RETRIEVAL │
      ┌──├─────────┼───────┼─────────┼─────────┼──────────┼──────────┼──────────┤
      │  │SHARED   │  Y    │   Y     │   N     │    N     │    N     │    N     │
      │  │UPDATE   │       │         │         │          │          │          │
      │  ├─────────┼───────┼─────────┼─────────┼──────────┼──────────┼──────────┤
      │  │SHARED   │  Y    │   Y     │   Y     │    Y     │    N     │    N     │
      │  │RETRIEVAL│       │         │         │          │          │          │
      │  ├─────────┼───────┼─────────┼─────────┼──────────┼──────────┼──────────┤
      │  │PROTECTED│  N    │   Y     │   N     │    N     │    N     │    N     │
Run   │  │UPDATE   │       │         │         │          │          │          │
unit  │  ├─────────┼───────┼─────────┼─────────┼──────────┼──────────┼──────────┤
A     │  │PROTECTED│  N    │   Y     │   N     │    Y     │    N     │    N     │
      │  │RETRIEVAL│       │         │         │          │          │          │
      │  ├─────────┼───────┼─────────┼─────────┼──────────┼──────────┼──────────┤
      │  │EXCLUSIVE│  N    │   N     │   N     │    N     │    N     │    N     │
      │  │UPDATE   │       │         │         │          │          │          │
      │  ├─────────┼───────┼─────────┼─────────┼──────────┼──────────┼──────────┤
      │  │EXCLUSIVE│  N    │   N     │   N     │    N     │    N     │    N     │
      │  │RETRIEVAL│       │         │         │          │          │          │
      └──└─────────┴───────┴─────────┴─────────┴──────────┴──────────┴──────────┘

Wait State

When a run unit cannot ready an area because a protected or exclusive restriction is already placed on that area by another run unit running under the same central version, it is placed in a wait state until the first run unit is finished.

Automatic Implicit Locking

The central version automatically maintains implicit record locks. These record locks are dependent on DBA specifications and on the area usage mode specified:

Default Usage Modes

Your DBA can assign default usage modes for subschema areas. The specified default determines the usage mode in which an area will automatically be readied for programs using that subschema. You do not have to code READY statements in programs that use such a subschema; however, if you issue a READY command for one area in the subschema, you must issue READY commands for all database areas to be accessed unless the FORCE option is specified for the default usage mode. Areas using the default usage mode combined with the FORCE option are automatically readied even if the run-unit already issued READY for other areas.

You can use the SUBAREA parameter of the IDMSRPTS utility to determine if the DBA has specified any default usage modes.