The below table describes the automatic concurrency control and locks used in multi-user mode and the commands that initiate them. Operations that only view data or the database structure are not affected by concurrency control or locking.
Type of Lock |
Command |
Description |
Concurrency Control |
Prevents one user from accidentally overwriting another user's changes. These commands can access the same table simultaneously. |
|
Row Lock |
ENTER form INSERT values LOAD FROM filespec |
When SET ROWLOCKS is on, a lock is only applied to a row. When off, a table lock is in effect. |
Table Lock |
INSERT subselect LOAD from filespec |
Must wait for commands that obtain table and database locks. Once obtained, this lock excludes all other concurrency control and locking until these commands have finished. |
Full Database Lock |
BACKUP ALL UNLOAD ALL |
All tables in the database are locked. |
Database Schema Lock |
Engages a full database lock preventing schema modifications, then releases the schema lock remaining in table lock. |
|
Cursor Lock |
OPEN cursorname |
Stops database schema commands but allows table locks; acts as a table lock. |
*A table lock is placed only if one table is unloaded. A database lock is placed if more than one table is unloaded.
The below table shows what happens when different commands try to access a table or database already being used by another command. The columns represent the type of control or lock already placed on the table or database. Each row has a heading with the name of the control or lock needed by the command trying to gain access to a table or database.
Concurrency Control |
Cursor Lock |
Row Lock |
Table Lock |
Database Lock |
Schema Lock |
|
Cursor Lock |
Access |
Access |
Access |
Wait |
Quit |
Wait |
Row Lock |
Access |
Access |
Access |
Wait |
Quit |
Wait |
Concurrency Control
|
Access |
Access |
Access |
Wait |
Quit |
Wait |
Table Lock |
Wait |
Wait |
Wait |
Wait |
Quit |
Wait |
Database Lock |
Wait |
Wait |
Wait |
Wait |
Quit |
Wait |
Schema Lock |
Wait |
Wait |
Wait |
Wait |
Quit |
Wait |