Informix Error -314
-314 Table table-name currently in use.
This statement tries to do something, such as dropping a table, that cannot be done while another user is using the table. Wait a short time, and try again. To ensure that no table is in use, open the database with DATABASE EXCLUSIVE.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-314 fires when a structural operation (typically DROP TABLE, but other DDL against the table
can trigger it too) is attempted while another session is actively using the table — an
open cursor, an in-progress transaction, or an active lock from concurrent access.
- Another session holds an open cursor or active transaction against the table at the moment the DDL is attempted.
- A busy production table where DDL is attempted during normal application traffic, rather than during a maintenance window.
- A prior session's connection or transaction wasn't cleanly closed, leaving the table appearing "in use" longer than actually intended.
- Concurrent DDL from another administrative session attempting a conflicting structural change at the same time.
Solutions / Resolution
- Wait briefly and retry, per the official guidance — many occurrences are transient, resolving once the other session's activity completes.
- Open the database with
DATABASE ... EXCLUSIVEif exclusive access is genuinely needed for the duration of the DDL operation, preventing new concurrent access while it runs. - Identify what's currently using the table and, if appropriate, coordinate with that session/application rather than repeatedly retrying blind.
- Schedule structural changes during a maintenance window for busy production tables, rather than during peak traffic.
Examples
Retrying after a transient conflict
DROP TABLE staging_import;
-- -314: another session currently has it open
-- wait briefly, then retry:
DROP TABLE staging_import;
Using exclusive database access for a guaranteed-clean DDL window
DATABASE sales EXCLUSIVE;
DROP TABLE staging_import;
CLOSE DATABASE;
Checking what's currently using the table
SELECT l.tabname, l.owner, s.username FROM sysmaster:syslocks l, sysmaster:syssessions s
WHERE l.owner = s.sid AND l.tabname = 'staging_import';
Diagnostic Checks
- Check
sysmaster:syslocksfor active locks against the table in question. - Check for long-running or idle-in-transaction sessions (
onstat -g ses) that might be holding it open unnecessarily. - Confirm whether the DDL genuinely needs to run during active traffic, or can be deferred to a maintenance window.
Related Errors / Related Topics
- -313 — "Not owner of table." Another table-level restriction on structural operations, in this case about ownership rather than concurrent access.
- -291 — "Cannot change lock mode of table." A related table-locking-lifecycle error, in the same general concurrent-access family.
Most occurrences are transient — retry after a short wait, or use DATABASE ... EXCLUSIVE if the
DDL genuinely needs guaranteed uncontended access.