Locks are assigned to IMAGE/SQL tables in two ways. First,
you can explicitly set a lock with the LOCK TABLE statement.
Second, you can implicitly assign locks on PUBLIC tables
depending on the operation, DBOPEN mode, and ALLBASE/SQL Isolation Level
as shown in Table 5-1 “Assigned Locks”.
Table 5-1 Assigned Locks
IMAGE/SQL or ALLBASE/SQL Operation | TurboIMAGE/XL DBOPEN Mode | ALLBASE/SQL Isolation Level | Lock Assigned |
---|
Any operation that modifies the TurboIMAGE/XL table | 1 through 4 | Any isolation level | Exclusive data set lock for master dataset. Predicate level lock for detail dataset if the "where" clause is specified. |
Read (SELECT) | 1 through 4 | RR, CS, or RC | Exclusive data set lock for master dataset. Predicate level lock for detail dataset if the "where" clause is specified. |
| | RU | None |
| 5 through 8 | Any isolation level | None |
The SQL statements that can modify TurboIMAGE/XL tables are INSERT, UPDATE, or
DELETE.
The DBOPEN mode is assigned at ATTACH time.
To see what mode is assigned,
use the IMAGESQL DISPLAY USERS command.
If you have DBA authority, you can
change the mode with the UPDATE USER command.
The following are the isolation levels supported in ALLBASE/SQL and IMAGE/SQL.
- RR
Repeatable Read. The transaction uses locking strategies to guarantee repeatable reads, the default isolation level.
- CS
Cursor Stability. Transaction uses locking strategies to assure cursor-level stability only.
- RC
Read Committed. Transaction uses locking strategies to retrieve only rows that have been committed by some transaction.
- RU
Read Uncommitted. Transaction reads data without obtaining additional locks.
The isolation levels are established with a BEGIN WORK statement.
Locks are released when a COMMIT WORK or ROLLBACK WORK statement
is issued.
Therefore, to release any locks, issue a COMMIT WORK statement as frequently
as possible.
For more information on isolation levels, and how they do locking on ALLBASE tables, refer to the ALLBASE/SQL Reference Manual.