Creating an error class

You can define a single error class to use with all databases managed by the same type of data server. For example, you can use the default Adaptive Server error class, rs_sqlserver_error_class, with any Adaptive Server database. There is no need to create another error class unless a database has special error-handling requirements.

An error class is a name used to group error action assignments. The syntax for the create error class command is:

create error class error_class

For example, to create an error class named pubs2_error_class, use this command:

create error class pubs2_error_class

Initially, rs_sqlserver_error_class, the default error class that is predefined to work with Adaptive Server databases, does not have a primary site. Since you can only create server-wide error classes at a primary site for a class, you need to designate one of the Replication Servers as a primary site for a Adaptive Server error class.

You must specify a primary site before you can modify a default error class. You can designate a site as primary by executing the create error class command for a Adaptive Server error class at that site. To do this, execute create error class rs_sqlserver_error_class at the primary site. Make sure all other Replication Servers have direct or indirect routes from the primary site.

The default error action for all errors returned by a data server is stop_replication. This is also the most serious action: it suspends replication for the database, as if you entered the suspend connection command. To assign less severe actions to errors you want to handle differently, use the assign action command. See “Assigning actions to data server errors” for more information.