Informix Error -6069: Tried to lock a table outside a transaction.
Cause and resolution
Tried to lock a table outside a transaction.
When you use a database that has transactions, the program must open all tables within the bounds of a transaction; that is, after a successful call to dbbegin(). Review the program logic to see that this action is performed. Possibly transaction-logging has been applied to the database since the last time that you used the program.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-6069 fires when a table is opened outside the bounds of a transaction on a database that has transactions — per the archived catalogue, all table opens must occur after a successful dbbegin() call. Transaction logging may also have been newly applied to the database since the program was last used.
- A table opened before dbbegin() succeeded, per the archived catalogue.
- Transaction logging newly applied to the database, per the archived catalogue, since the program was last run against it.
Solutions / Resolution
- Open all tables after a successful dbbegin() call, per the archived catalogue, on a transaction-logged database.
Examples
N/A
No specific triggering statement is documented beyond the function-level condition described above.
Diagnostic Checks
- Confirm table opens occur after dbbegin(), and check whether logging was recently added to the database.
Related Errors / Related Topics
- -6067 — "Tried to unlock a table inside a transaction."
- -6065 — "Database does not have transactions."
- -6064 — "Tried to terminate a transaction that hasn't been started."
Open tables only after dbbegin() succeeds on a logged database — check if logging was added recently.