Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > LOCK TABLE >

Locking Granularity

The default granularity for locking a table is at the page level, or whatever you specify (either PAGE or ROW) in the IFX_TABLE_LOCKMODE environment variable, or if that is not set, by setting DEF_TABLE_LOCKMODE in the ONCONFIG file. The LOCKMODE clause of the CREATE TABLE or ALTER TABLE statement can override the default locking granularity by specifying PAGE, ROW, or (for Extended Parallel Server only) TABLE for a specified table. The LOCK TABLE statement, however, always locks the entire table, overriding any other locking granularity specification for the table. For Extended Parallel Server, the LOCK MODE clause of the CREATE INDEX statement can specify COARSE or NORMAL locking granularity for an index.

In all of these contexts, the term "lock mode" means the locking granularity. In the context of the SET LOCK MODE statement, however, "lock mode" refers to the behavior of the database server when a process attempts to access a row or a table that another process has locked.

Related Information

Related statements: BEGIN WORK, COMMIT WORK, SAVE EXTERNAL DIRECTIVES, SET ISOLATION, SET LOCK MODE, and UNLOCK TABLE

For a discussion of concurrency and locks, see the IBM Informix Guide to SQL: Tutorial.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]