Informix Error -760
Cause and resolution
Remote procedure must commit or rollback before returning.
Your remote procedure must execute a COMMIT WORK or ROLLBACK WORK statement before that procedure returns control to your application.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-760 fires when a remote procedure (an SPL routine called on a different database server than
the calling application's connection) returns to the calling application without having issued a
COMMIT WORK or ROLLBACK WORK — per the official guidance, a remote procedure specifically must
close out its own transaction before returning control.
- A remote procedure's logic reaching its
RETURNstatement without a precedingCOMMIT WORK/ROLLBACK WORK, per the official guidance — the direct, only cause. - An error-handling path inside the remote procedure that skips the commit/rollback, similar in nature to -535's missing-commit pattern, but specific to the remote-procedure requirement.
- A routine written for local (same-connection) use, reused as a remote procedure without adding the explicit commit/rollback that remote execution specifically requires.
Solutions / Resolution
- Add an explicit
COMMIT WORKorROLLBACK WORKbefore everyRETURNpath in the remote procedure, per the official guidance. - Trace every exit path out of the procedure, including error-handling branches, confirming each one reaches a commit or rollback before returning.
Examples
The disallowed attempt
-- procedure created and stored on server_b:
CREATE PROCEDURE remote_update_order(p_order_id INT, p_status CHAR(10))
UPDATE orders SET status = p_status WHERE order_id = p_order_id;
-- -760: no COMMIT WORK/ROLLBACK WORK before returning
END PROCEDURE;
-- called from a session connected to server_a:
CONNECT TO 'stores7@server_a';
EXECUTE PROCEDURE server_b:remote_update_order(42, 'shipped');
Corrected
CREATE PROCEDURE remote_update_order(p_order_id INT, p_status CHAR(10))
UPDATE orders SET status = p_status WHERE order_id = p_order_id;
COMMIT WORK;
END PROCEDURE;
The requirement is specific to a procedure invoked from a different server than the one it runs on — an ordinary local call (same server as the caller) doesn't need this explicit commit/rollback the way remote execution does.
Diagnostic Checks
- Trace every exit path from the remote procedure, including error handlers, confirming a
COMMIT WORK/ROLLBACK WORKprecedes each one.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -760 in this set yet.
A remote procedure must close out its own transaction before returning — trace every exit path, including error handlers, for a missing commit/rollback.