Manual Record Locking Combinations - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Sharing Files and Locking Records
8.4 Ensuring Successful Record Locking
When you specify manual record locking you must use all of the following clauses:
An APPLY LOCK-HOLDING clause in the I-O CONTROL paragraph
An OPEN ALLOWING clause at file open time
An ALLOWING clause on each record operation (except DELETE)
The possible ALLOWING clauses for the record operations (that is, the READ,
WRITE, REWRITE, and START statements) are as follows:
ALLOWING NO OTHERS
cannot perform READ, WRITE, DELETE, or UPDATE statements. This
clause constitutes a lock for write and does not allow readers.
ALLOWING READERS—Locks records against WRITE, REWRITE, and
DELETE access by all streams including the stream that issues the
statement. Others can perform READ statements.
ALLOWING UPDATERS
can perform READ, REWRITE, and DELETE statements. This clause
constitutes a no record lock condition.
However, if the file's OPEN mode is INPUT, using the ALLOWING clause on the
record operation does not lock the record.
On Tru64 UNIX and Windows NT systems, for indexed files only, the WRITE,
REWRITE, and START statements do not acquire a record lock.
On Tru64 UNIX and Windows NT systems for indexed files only, ALLOWING
READERS is treated as ALLOWING NO OTHERS if the file is opened in I-O
mode or as ALLOWING ALL if the file is opened in INPUT mode.
Table 8–5 shows the valid and invalid ALLOWING combinations for manual
record locking. The columns represent the lock held, and the rows represent the
lock requested.
Table 8–5 Manual Record Locking Combinations
I-O Attempt (for
subsequent stream)
READ
REWRITE
DELETE
START
2
Some exceptions exist on Windows NT and Tru64 UNIX. See Compaq COBOL Reference
Manual for details.
8–20 Sharing Files and Locking Records
2
—Locks records for exclusive access. Others
2
—Does not apply any locks to the records. Others
Updaters
Allowing Updaters
Y
Allowing Readers
Y
Allowing no others
Y
Allowing no others
Y
Y
Allowing Updaters
Y
2
Lock Held (for first stream)
Readers
No Others
Y
N
Y
N
N
N
N
N
N
N
Y
N
(continued on next page)
2

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents