HP 3000 Manuals

Single Record Locking [ Micro Focus COBOL for UNIX COBOL User Guide ] MPE/iX 5.0 Documentation


Micro Focus COBOL for UNIX COBOL User Guide

Single Record Locking 

A program that specifies single record locking for a file (either
explicitly or implicitly) can hold only one record lock in that file at
any one time.  Such a program can acquire a single record lock in one of
two ways:  manually or automatically.

Manual Single 

Record Locking

You can specify manual single record locking for any file in your program
by using the LOCK MODE IS MANUAL clause in the SELECT statement.

A program can acquire a single record manual lock by accessing a record
using a READ WITH LOCK statement.  The lock is released when this program
does one of the following:

   *   accesses any other record in the file with any file operation
       except START

   *   closes the file

   *   executes a COMMIT statement

   *   executes a ROLLBACK statement

   *   executes an UNLOCK statement on the file.

Single Record Locking 

Automatic 

You can specify automatic single record locking for a file in your
program by using the LOCK MODE IS AUTOMATIC clause in the SELECT
statement.

A program automatically acquires a single record lock when it reads a
record in a file.  The lock is released when this program does one of the
following:

   *   accesses any other record in the file with any file operation
       except START

   *   closes the file

   *   issues a COMMIT statement

   *   issues a ROLLBACK statement

   *   executes an UNLOCK statement on the file.



MPE/iX 5.0 Documentation