Locking
The database server uses locks, which can affect concurrency and performance. You can monitor and administer locks.
- Locks
A lock is a software mechanism that you can set to prevent others from using a resource. You can place a lock on a single row or key, a page of data or index keys, a whole table, or an entire database. - Configuring the lock mode
When you create a table, the default lock mode is page. You can change the lock mode (and thus increase or decrease concurrency) when you create or alter tables or by setting the IFX_DEF_TABLE_LOCKMODE environment variable or the DEF_TABLE_LOCKMODE configuration parameter. - Setting the lock mode to wait
When an application process encounters a lock, the default behavior of the database server is to return an error. Instead, you can run an SQL statement to set the lock mode to wait. This specifies that an application process does not proceed until the lock is removed. - Locks with the SELECT statement
The type and duration of locks that the database server places depend on the isolation level set in the application, the database mode (logging, nonlogging, or ANSI,) and on whether the SELECT statement is within an update cursor. These locks can affect overall performance because they affect concurrency. - Locks placed with INSERT, UPDATE, and DELETE statements
When you execute an INSERT, UPDATE, or DELETE statement, the database server uses exclusive locks. An exclusive lock means that no other users can update or delete the item until the database server removes the lock. - The internal lock table
The database server stores locks in an internal lock table. When the database server reads a row, it checks if the row or its associated page, table, or database is listed in the lock table. If it is in the lock table, the database server must also check the lock type. - Monitoring locks
You can analyze information about locks and monitor locks by viewing information in the internal lock table that contains stored locks. - Locks for smart large objects
Smart large objects have several unique locking behaviors because their columns are typically much larger than other columns in a table.
Parent topic: Performance Guide