Guardian Programmer's Guide

Table Of Contents
Coordinating Concurrent File Access
Guardian Programmer’s Guide 421922-014
3 - 4
Setting the Exclusion Mode
a shared database. Any transaction-processing application would be typical.
Here, data integrity can be provided at a lower level (for example, the record level).
Protected
The opening process tolerates only other openers with read-only access mode. In
addition, processes attempting to open the file for exclusive access are barred
from the file. Different processes may have the same file open in protected mode,
but only if all openers are opening the file for read-only access.
Protected mode is used when a consistent view of the entire database is required,
such as for end-of-period stock taking or balance sheet preparation.
Exclusive
The opening process allows no other access to the file until the file is closed.
Use exclusive mode only when no other access can be tolerated; for example,
during major restructuring of your database.
Figure 3-1 summarizes the effects of all possible combinations of access mode and
exclusion mode. When you read the table, the exclusion and access mode with which
some other process has the file open are given along the top of the table. The
exclusion and access mode you are requesting to open the file with are shown in the
leftmost columns. “Y” at the intersection indicates that the new open is allowed and
the requested permissions granted.
You use the exclusion parameter of the FILE_OPEN_ procedure to specify the
exclusion mode. This parameter can have the following values:
If the parameter is omitted, 0 (shared mode) is assumed by default.
0 Shared access
1 Exclusive access
3 Protected access