MFDBFH supports three types of record locking strategy:
- Table Record Locking
- Record locks are maintained in a separate lock table, and the associated lock behavior when using the COBOL READ, WRITE, and
REWRITE verbs is the same as when accessing disk files via non-MFDBFH file handling operations or when using Fileshare. This
is the default.
- Database Record Locking
- With this record locking strategy, MFDBFH makes use of the RDBMS to directly lock records in the file table. When records
are locked this way, they will remain locked until the end of the current database transaction. This means that database record
locking is restricted to being only available when using transactional files.
- The benefit of using database record locking instead of table record locking is performance, but this comes at the cost of
loss of compatibility with regular COBOL file I/O, and the inability to concurrently access the file non-transactionally (that
is, a transactional file opened using the database record locking strategy by CICS cannot be shared with batch programs, which
will open files non-transactionally).
-
To enable the database record locking strategy for transactional files, set the following environment variable:
MFDBFH_RECORD_LOCKING=database
- In-memory Record Locking
- This record locking strategy is used for I/O operations performed on files that have been allocated for exclusive use (that
is, DISP=OLD, DISP=NEW, or DISP=MOD) in batch jobs running under an enterprise server region. This is the most performant
of all of the record locking strategies.