Schema Locks

Whereas a table-lock in the IQ main store places a lock on all the rows in the table, a schema lock places a lock on the table's schema.

Schema locks ensure that transactions using a table are not affected by schema changes initiated by other connections. For example, a schema lock prevents an ALTER TABLE statement from dropping a column from a table when that table is being read by an open cursor on another connection. Readers and writers both take schema locks.

A schema lock can be modified for exclusive access. The exclusive access can only be granted when there are no other schema locks present. This means that there are no other readers or writers to the table. All DDL statements will take an exclusive schema lock prior to being allowed to execute. Only one connection can acquire an exclusive schema lock on a table at any timeā€”all other attempts to lock the table's schema will either block or fail with an error.

Related concepts
Row Locks
Write-Intent Locks
Table-Level DML Locking Considerations
Row-Level DDL Locking Considerations