Specifying a Precommit Stored Procedure Call

You can configure Subscription Service to call a stored procedure after the database insert, update, or delete operation and prior to commit. You can use this stored procedure as a hook to accomplish further processing inside the database and have results returned to the adapter.

To specify a recommit stored procedure call, specify the precommit stored procedure name in the Pre-Commit Stored Procedure field of the Subscription Options tab.

The adapter will call the precommit stored procedure with the following syntax:

{call <pre-commit stored procedure name>(?, ?, ?)}.

This stored procedure has to be defined with a specific interface as described in the following table.

Name Type Description
RETURN_CODE INTEGER RETURN_CODE = 0, the adapter assumes the procedure was successful and writes a success message to the SDK INFO trace role when the verbose mode is used.

RETURN_CODE <> 0, the adapter assumes the procedure was not successful and writes SP_TEXT to the SDK ERROR trace role (whether verbose mode is on or off).

If the message has a reply subject, this output value will be returned to the message sender.

SP_TEXT VARCHAR If the message has a reply subject, this output string will be returned to the message sender.
DO_ROLL BACK INTEGER DO_ROLLBACK = 0, the adapter commits the transaction and confirms the original message.

DO_ROLLBACK <> 0, the adapter rolls back the transaction and does not confirm the message.

Note: Not confirming the message changes the RVCM behavior. All subsequent RVCM messages will not be confirmed. It can only be done when this RVCM behavior is really desired.