Technical data

PROTECTED RETRIEVAL (the system default)
PROTECTED UPDATE
EXCLUSIVE RETRIEVAL
EXCLUSIVE UPDATE
BATCH RETRIEVAL
BATCH UPDATE
Use the CONCURRENT usage modes for applications requiring separate run
units to simultaneously access the database. They allow other run units to
perform a READY statement on your realm, and possibly change or delete the
database records in that realm.
Use the PROTECTED usage modes only when unrestricted access might produce
incorrect or incomplete results. Protected access prevents other run units from
making changes to the data in your realm. However, run units in RETRIEVAL
mode can still access (read-only) your realm.
Use the EXCLUSIVE usage modes only when you want to lock out all other
users. The EXCLUSIVE mode speeds processing for your run unit and prevents
other run units from executing a READY statement on your realm. When you
specify EXCLUSIVE access, use only the realms you need. Eliminating the use
of unnecessary realms minimizes lockout. Use the EXCLUSIVE allow mode to
get the best performance from a single run-unit application. Care must be taken,
however, because other run units are locked out and must wait for the exclusive
run unit to finish before it can begin operations.
Use the BATCH RETRIEVAL usage mode for concurrent run units to update the
realm. Use the BATCH UPDATE usage mode to access or update any data in
the realm while preventing concurrent run units from accessing or updating the
realm.
For more information on READY usage mode conflicts, see the READY statement
in the READY. It summarizes the effects of usage mode options on run units
readying the same realms.
6.1.1 Record Locking
Concurrent run units can reference realms that map to the same storage area;
the same records can be requested by more than one transaction at the same
time. If two different transactions were allowed to modify the same data, that
data would be rendered invalid. Each modification to the original data would be
made in ignorance of other modifications, and with unpredictable results. Oracle
CODASYL DBMS preserves the integrity of data shared by multiple transactions.
It also provides levels and degrees of record locking. You can control access to, or
lock:
All records in a realm you intend to access
Individual records as they are retrieved by DML statements
You can also lock records totally or allow some retrieval functions.
Record locking begins with the execution of the first READY statement in the run
unit. At that time the DBCS is told of your storage area locking requirements.
If you specify EXCLUSIVE allow mode, no other run unit is allowed to access
records in the specified realms. This is all the locking that the DBCS need do. If
6–2 DML Programming—Tips and Techniques