Table-Level Locking

All table-level locks occur automatically, based on the type of operation a user requests.

You need not explicity request a lock; the transaction that has access to the table holds the lock.

When a table is locked in SAP Sybase IQ, no other transaction, except data definition operations, can have write access to it. Any other write transaction that attempts to access a table with a write lock on it receives an error. Any transaction can obtain read access.

The locks maintain the reliability of information in the database by preventing concurrent access by other transactions. The database server retains all the locks acquired by a transaction until the transaction completes, due to either a commit or a rollback.

You can reserve write locks on a set of tables within a new transaction using the LOCK TABLE statement. LOCK TABLE commits the current transaction and allows transactions to enqueue until the locks are available.