Lock Table support

In Sybase ETL 4.8, you can use the Lock Table statement to acquire exclusive locks on a set of Sybase IQ tables, and prevent these tables from being accessed or modified by other concurrent transactions. To lock a table in EXCLUSIVE mode, you must be the table owner or have DBA authority. When an exclusive table lock is applied, no other transaction can execute queries, perform updates of any kind, or any other action against the locked table.

When Lock Table statement locks the tables of the first project, the second project does not fail; instead it waits for a user-defined time before trying again. This ensures the projects are not required to wait for a manual restart or for the next scheduled execution. For example, if project ‘A’ is writing data to the target table and project ‘B’ is trying to acquire the exclusive lock on the same table, project 'B' is made to wait for the specified wait time before it can acquire the lock. The wait time is the maximum blocking time for acquiring the EXCLUSIVE lock. When a time argument is given, the data update statements (DML) wait for the specified period of time if the target tables are locked. Otherwise the server waits indefinitely until a lock is available or an interruption occurs.

The syntax for applying an exclusive table lock is:

LOCK TABLE table-name WITH HOLD IN EXCLUSIVE MODE WAIT [time]

Where:

This statement blocks or delays other transactions that may require access to the table. LOCK TABLE statement allows direct control over concurrency at a table level, independent of isolation level.

The following Sybase IQ components supports the exclusive lock table statement:

You can set two additional parameters for these components, which, when writing to the Sybase IQ database, appropriately lock the Sybase IQ table before writing the data.

If the Lock Table mode is selected, Sybase ETL generates a Lock Table statement and executes it before any other SQL statements are executed on the table.

For detailed information about the Lock Table feature in Sybase IQ, see Chapter 6, “SQL Statements” in the Sybase IQ 12.7 Reference Manual.

For information about new parameters in the ETL components for Sybase IQ, see Chapter 5, “Components” in the Sybase ETL 4.8 Users Guide.