Designing to minimize resource contention
One reason to use an MSDB is its fast access to data and high availability for processing.
To maintain high availability, you should design to avoid the contention for resources that is likely to happen in a high transaction rate environment.
The following is a list of performance-related considerations. Some of the considerations do not apply exclusively to MSDBs, but they are listed to give a better understanding of the operational environment.
- Access by Fast Path transactions to DL/I databases and use of the alternate PCB should be kept to a minimum. Use of the alternate PCB should be kept to a minimum because FP transactions must contend for resources with IMS transactions (some of which could be long running). Also, common sync point processing is invoked and entirely serialized in the IMS control region.
- To avoid resource contention when sharing MSDBs between Fast Path and DL/I transactions, You should try to make commit processing often and to avoid long-running scans.
- GH for read/update delays any sync point processing that intends to update the same MSDB resource. Therefore, GH logic should be used only when you assume the referenced segments will not be altered until completion of the transaction. If the resource is being updated, release is at the completion of sync point. Otherwise, the release is at entry to sync point.
- The following consideration deals with deadlock prevention. Deadlock
can occur if transactions attempt to acquire (GH calls) multiple MSDB
resources.
Whenever a request for an MSDB resource exists that is already allocated and the levels involved are HOLD or UPDATE, control is passed to IMS to detect a potential deadlock situation. Increase in path length and response time results. The latter can be significant if a deadlock occurs, thus requiring the pseudo abend of the transaction.
In order to reduce the likelihood of deadlocks caused by resource contention, sync point processing enqueues (UPDATE level) MSDB resources in a defined sequence. This sequence is in ascending order of segment addresses. MSDB segments are acquired in ascending order of keys within ascending order of MSDB names, first the page-fixed ones then the pageable MSDBs.
The application programmer can eliminate potential deadlock situations at call time by also acquiring (GH calls) MSDB resources using the same sequence.
- From the resource allocation scheme discussed earlier, you probably
realize that FLD logic should be used whenever possible instead of
GH/REPL logic.
- The FLD/VERIFY call results in an enqueue at the READ level, and if no other levels are involved, then control is not passed to IMS. This occurrence results in a shorter path length.
- The FLD/CHANGE call, when not issued in connection with VERIFY logic does not result in any enqueue within either Fast Path or IMS.
- FLD logic has a shorter path length through the Program Request Handler, since only one call to process exists instead of two needed for GH/REPL logic.
- The FLD/CHANGE call never waits for any resource, even if that same resource is being updated in sync point processing.
- The FLD/VERIFY call waits only for sync point processing during which the same resource is being updated.
- With FLD logic, the resource is held in exclusive mode only during sync point processing.
In summary, programming with FLD logic can contribute to higher transaction rates and shorter response times.
The following examples show how the MSDB record is held in exclusive mode:

The following notes are for the preceding figure:
- MSDB record R1 is held in exclusive mode against:
- Any MSDB calls except CHANGE calls
- Any other sync point processing that intends to update the same record
- MSDB record R1 is held in exclusive mode against:
- Any other GH for update
- Any other sync point processing that intends to update the same record

The following notes are for the preceding figure.
- MSDB record R1 is held in exclusive mode against:
- Any MSDB calls except CHANGE calls
- Any other sync point processing that intends to update the same record
- MSDB record is held in exclusive mode for the duration of the FLD call against any other sync point processing that intends to update the same resource