System Procedures Hold Table Lock When Modifying System Tables

System procedures cannot acquire table locks on system tables explicitly. However, in a system using Sybase’s Failover, system procedures on both companions could attempt to modify the system tables at the same time.

To prevent deadlocks, if you issue a system procedure to modify a system table, the system procedure acquires a table lock on the proxy table of the system table it is modifying. That is, if you issue a system procedure to alter the syslogins system table on primary companion MONEY1, the system procedure acquires a table lock on the syslogins proxy table on the secondary companion, PERSONNEL1.

The system procedure then modifies the syslogins proxy table on PERSONNEL1, and the syslogins proxy table updates the syslogins system table on MONEY1. After the changes are committed, the table locks on the proxy syslogins system table are released.

Any other system procedures that need to make changes to the same system table are in a queue for that table. After the lock is released, they acquire the table lock.

You can set the amount of time, in seconds, system procedures wait in the queue for the locked proxy system table with the sp_configure “dtm lock timeout period” command. For more information, See the dtm lock timeout period parameter description in “Setting Configuration Parameters” in the System Administration Guide.