Informix Error -6067: Tried to unlock a table inside a transaction.
Cause and resolution
Tried to unlock a table inside a transaction.
You cannot call dbunlock() inside a transaction, that is, after you call dbbegin() and before you call dbcommit() or dbrollback(). When you use transaction processing, all locks must remain in effect until the transaction is committed or rolled back. Ending the transaction releases all locks automatically.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-6067 fires when dbunlock() is called between dbbegin() and dbcommit()/dbrollback() — per the archived catalogue, all locks must remain in effect for the whole transaction and are released automatically when it ends.
- An explicit dbunlock() call made inside an active transaction, per the archived catalogue — the direct, only cause.
Solutions / Resolution
- Remove the explicit dbunlock() call inside the transaction, per the archived catalogue — locks release automatically at commit/rollback.
Examples
N/A
No specific triggering statement is documented beyond the function-level condition described above.
Diagnostic Checks
- Check whether dbunlock() is being called between dbbegin() and dbcommit()/dbrollback().
Related Errors / Related Topics
- -6069 — "Tried to lock a table outside a transaction."
- -6022 — "Lock was denied."
- -6064 — "Tried to terminate a transaction that hasn't been started."
Locks release automatically at commit/rollback — don't call dbunlock() inside the transaction.