Because the synchronization of databases is done by the application, the error handling must also be implemented in the application, that is, in the stored procedures. Transactions can generate errors that appear either at the system or at the application level. The system level errors are typically fatal; that is, they cannot be recovered from automatically.
An application level error occurs when the original behavior of the transaction is no longer valid. Typically this occurs when a conflict is detected. For instance, an order is inserted for a customer who no longer exists in the master database.
There are a number of ways to recover from this kind of error:
▪ Resolve the error automatically inside the transaction by using a conflict resolution rule, such as "the current master version wins."
▪ Leave the resolution of the error to the user or system administrator. An error log table can be used for storing sufficient information about the error.
▪ Combination of the previous options, for example, resolve the conflict automatically but inform a user about the resolution by using an error log table.
The method to use depends on the application and its requirements.