Informix Error -521
-521 Cannot lock system catalog table-name.
You cannot lock any of the tables that comprise the system catalog. All users need them at all times. The database server handles concurrent access to them correctly, so simply remove this statement from your program.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-521 fires when a LOCK TABLE statement names one of Informix's own system-catalog tables — the
server manages concurrent access to the catalog itself and doesn't allow an explicit lock to be
taken on it.
LOCK TABLEissued directly against asys*catalog table, per the official guidance — the direct, only cause.- Generated or templated SQL that locks tables from a list, where the list wasn't filtered to exclude catalog tables before the lock statements were built.
- A misunderstanding of why a catalog-table lock would be needed at all — since the server already serializes catalog access correctly, an explicit lock is never actually necessary.
Solutions / Resolution
- Simply remove the
LOCK TABLEstatement, per the official guidance — the server handles concurrent access to the system catalog correctly on its own, so there's no scenario where an explicit catalog lock is needed. - If a broader locking guarantee was the real goal, lock the specific application tables involved instead of the catalog tables that describe them.
Examples
The disallowed attempt
LOCK TABLE systables IN EXCLUSIVE MODE;
-- -521: Cannot lock system catalog systables.
The fix — just remove it
-- No LOCK TABLE needed here at all; the server already serializes
-- catalog access correctly.
Diagnostic Checks
- Confirm the table named in the
LOCK TABLEstatement is asys*catalog table (owned byinformix, persystables) rather than an application table with a similar name.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -521 in this set yet.
There's no fix beyond removing the statement — the server already handles catalog-table concurrency correctly without an explicit lock.