Chapter 12. Administering SQL Remote for AdaptiveSer ver
Enterprise
Error reporting and handling
Thissection describes how errors are reported and handled by the Message
Agent.

Default error handling

Thedefault action taken by the Message Agent when an error occurs is to
recordthe fact in its log output. TheMessage Agent sends log output to a
windowor a log file recording its operation. Bydefault, log output is sent to
thewindow only; the -o command-line option sends output to a log file as
well.
TheMessage Agent may print more information in the output log than in the
window.The Message Agent log includes the following:
Listingof messages applied.
Listingof failed SQL statements.
Listingof other errors.
UPDATEconflicts are not
errors UPDATEconflicts are not errors, and so are not reported in the Message
Agentoutput.

Implementing error handling procedures

SQLRemote allows you to carry out some other process in addition to
logginga message if an error occurs. TheREPLICATION_ERROR database
optionallows you to specify a stored procedure to be executed by the
MessageAgent when an error occurs. Bydefault no procedure is executed .
Theprocedure must have a single argument of type CHAR or VARCHAR.
Theprocedure is called with any error messages and with the SQL statement
thatcauses the error.
Whilethe option allows you to track and monitor errors in replication, you
muststill design them out of your setup: thisoption is not intended to
resolvesuch errors.
Forexample, the procedure could insert the errors into a table with the
currenttime and remote user ID, and this information can then replicate back
tothe consolidated database. Anapplication at the consolidated database can
createa report or send e-mail to an administrator when errors show up.
Forinformation on setting the REPLICATION_ERROR option, see
“SQLRemote options” on page 315.
271