Error class

An error class determines how Replication Server handles the errors that are returned by your gateway. You must use the create error class command to create an error class for your gateway.

You can define error processing for data server errors with the Replication Server API. You can create an error class for a database and specify responses for each error that the data server returns.

NoteReplication Server 15.2 and later includes connection profiles pre-loaded with error classes for actively supported databases. See “Connection profiles,” in Chapter 7, “Managing Database Connections” in the Replication Server Administration Guide Volume 1 and “Default non-ASE error classes,” in Chapter 6, “Handling Errors and Exceptions” in the Replication Server Administration Guide Volume 2.

Use the assign action command to tell Replication Server how to respond to the errors returned by your gateway. Table 6-1 lists the possible actions.

Table 6-1: Replication Server actions for data server errors

Action

Description

ignore

Assume that the command succeeded and that there is no error or warning condition to process. This action can be used for a return status that indicates successful execution.

warn

Log a warning message, but do not roll back the transaction or interrupt execution.

retry_log

Roll back the transaction and retry it. The number of retry attempts is set with configure connection. If the error recurs after exceeding the retry limit, write the transaction into the exceptions log and continue, executing the next transaction.

log

Roll back the current transaction and log it in the exceptions log. Then continue, executing the next transaction.

retry_stop

Roll back the transaction and retry it. The number of retry attempts is set with configure connection. If the error recurs after retrying, suspend replication for the database.

stop_replication

Roll back the current transaction and suspend replication for the database. This is equivalent to using suspend connection, and this is the default action.

Since this action stops all replication activity for the database, it is important to identify the data server errors that can be handled without shutting down the database connection and assign them another action.

The default error action is stop_replication. If you do not assign another action to an error, Replication Server shuts down the connection to your gateway.

See the Replication Server Reference Manual for more information about create error class and assign action.