Previous Topic: LOCK TABLENext Topic: Example


Description

table-name

Specify the name of the table to be locked. The table must be a base table described in the CA Datacom Datadictionary, but not a CA Datacom Datadictionary table.

IN SHARE MODE

Acquires a shared lock for the unit of recovery in which the statement is executed. The lock prevents other concurrent units of recovery from inserting, updating or deleting rows in the identified table.

Using the SHARE mode of the LOCK TABLE statement ensures that the data retrieved by your application is valid, that is to say, has been committed by a previous transaction.

IN EXCLUSIVE MODE

Acquires an exclusive lock for the unit of recovery in which the statement is executed. The lock prevents other concurrent units of recovery from acquiring any shared or exclusive row or table lock.

Using either mode of the LOCK TABLE statement ensures that your application can do a repeatable read. This isolation level provides maximum protection from other executing application programs. When a program executes with repeatable read protection, rows referenced by the program cannot be changed by other programs until the program reaches a commit point.

Neither lock prevents rows from being read with user isolation (ISOLEVEL=U in Preprocessor options) since no locks are acquired by user isolation.