Informix Error -718: Statement is invalid while a global transaction is suspended.
Cause and resolution
Statement is invalid while a global transaction is suspended.
If a database server that is acting as a Resource Manager in an X/Open distributed transaction-processing environment has suspended a transaction, its next statement must be xa_start. All other statements are disallowed.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-718 fires when any statement other than xa_start is issued while the Resource Manager (this
database server, from the XA transaction manager's perspective) has a suspended global
transaction — per the official guidance, once suspended, the very next statement must resume it
via xa_start; nothing else is permitted in between.
- An ordinary SQL statement issued after
xa_end(TMSUSPEND)(or equivalent suspension) but beforexa_startresumes the transaction, per the official guidance — the direct, only cause. - Application/connection-pooling code that doesn't track suspension state, allowing another part of the program to issue a statement on the connection while it still holds a suspended global transaction.
Solutions / Resolution
- Issue
xa_startto resume the suspended transaction before any other statement, per the official guidance — this is the only statement allowed at this point. - Audit connection-handling code for suspension-state tracking, ensuring no other code path can issue a statement on a connection that currently holds a suspended global transaction.
- If the transaction genuinely doesn't need to be suspended, review why
xa_end(TMSUSPEND)was called at all, rather than a normal transaction flow without suspension.
Examples
The disallowed statement after suspension
/* xa_end(xid, TMSUSPEND) was just called */
EXEC SQL SELECT * FROM orders WHERE order_id = 42;
/* -718: only xa_start is allowed here */
Corrected — resume first
xa_start(xid, TMRESUME);
EXEC SQL SELECT * FROM orders WHERE order_id = 42;
Diagnostic Checks
- Confirm whether the connection currently holds a suspended global transaction, and if so,
ensure the very next statement issued is
xa_start.
Related Errors / Related Topics
- -700 — "Statement is invalid within a global transaction." A related XA-environment
restriction, on
BEGIN/COMMIT/ROLLBACK WORKspecifically within an active (not suspended) global transaction. - -701 — "Statement is invalid within the XA environment." A related, broader list of restricted statements within an active global transaction.
Once a global transaction is suspended, xa_start must be the very next statement — nothing
else is permitted until it resumes.