Handling Record Locks

By default, when a read operation encounters a locked record, the operation returns a locked record status. However, the operation does update the record area to show the contents of the record. After this operation, the current record pointer remains associated with the locked record, so that a following READ NEXT operation continues to try and access the same record.

The following configuration options affect this behavior:
Configuration Option Description
IGNORELOCK When set to ON, specifies that record locks are to be ignored when reading files open for input
RETRYLOCK When set to ON, specifies that operations that try to read locked records should be retried until the operation is successful. Can also be set to an integer, which specifies the maximum number of retries before the operation is aborted.
LOCKTYPE When set to 1, record locks are placed on the record itself, which means that a read operation that meets a locked record cannot return the data record. In this case the contents of the record area following the read are undefined.
SKIPLOCK When set to ON specifies that, following a read encountering a locked record, a READ NEXT operation returns the following record
Note: To bypass the locked record, you can also use the START…KEY IS GREATER THAN.. statement.