 |
» |
|
|
 |
 |
 |

5.34 How are isolation levels used?
Key points
- When SQL statements that reference a user table are executed,
locks of different kinds are obtained on the table by default. You can help control
how long locks are held or if locks are obtained by altering
the isolation level of the transaction.
- An isolation level is the degree to which a transaction is separated from all
other concurrent transactions. In general, you should choose the least
restrictive isolation level that meets each transaction's needs, to
achieve the most concurrency.
- ALLBASE/SQL supports four isolation levels. They are briefly described below,
in order from most restrictive to least restrictive.
All of the isolation levels will be described in
greater detail on the next few pages.
- Repeatable Read (RR) -- default.
- All locks obtained by the transaction are held until the transaction ends.
- Cursor Stability (CS)
- S locks are released before the transaction ends (the application program has
some control over when they are released).
- Read Committed (RC)
- S locks are automatically released by ALLBASE/SQL immediately after they are
obtained.
- Read Uncommitted (RU)
- S locks are not acquired when the transaction reads data.
- The isolation level of a transaction is an attribute that can be specified
using an optional clause in the
BEGIN WORK statement. For example:
BEGIN WORK CS;

Page last updated on November 29, 1995
|
|
|