Concurrent editing and data locks

When you are viewing or editing records in a multi-user environment, there is always the possibility that more than one person is using the same database at the same time. The FM/IMS Browse and Edit functions are designed to release data locks whenever control is returned to the user, to allow for concurrent user access. This is true for both DLI and BMP access modes.

Since FM/IMS does not hold locks on the current database record during user interactions, it uses other mechanisms to ensure that the data being changed has not been updated by other users during your read and editing operations. The mechanism is:

  • When you display data in your Editor, FM/IMS creates a copy of the data in memory.
  • When you request a change to the data, such as overtyping some details and pressing Enter, FM/IMS creates another copy of the requested changes and then performs an integrity check. In this check, FM/IMS:
    • Reads the segment as stored in the database again
    • Compares this segment to the original copy in memory (that is, before you made changes).
    • If the two segment versions are the same, the requested changes are stored in the IMS buffers and an update lock is issued on the database record.

      If they are not the same, that is someone else has modified the segment between the time that you initially read the data and the time that you attempted to change it, FM/IMS issues a warning and does not store the requested change.

  • The update lock remains on the database record until the changes have been committed to the database, at which point the lock is released. To minimize the locking time and ensure that the latest updated database records are available to other users, you can use the AUTOSAVE option with an Edit Checkpoint Frequency of 1. This instructs FM/IMS to commit any updates immediately upon passing the integrity check, effectively releasing the lock as soon as you enter the changes.