HPlogo IMAGE/SQL Administration Guide: HP 3000 MPE/iX Computer Systems > Chapter 5 IMAGE/SQL Locking

Lock Assignment

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

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 OperationTurboIMAGE/XL DBOPEN ModeALLBASE/SQL Isolation LevelLock Assigned
Any operation that modifies the TurboIMAGE/XL table1 through 4Any isolation levelExclusive data set lock for master dataset. Predicate level lock for detail dataset if the "where" clause is specified.
Read (SELECT)1 through 4RR, CS, or RCExclusive data set lock for master dataset. Predicate level lock for detail dataset if the "where" clause is specified.
  RUNone
 5 through 8Any isolation levelNone

 

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.

Feedback to webmaster