Implementing conflict resolution
Thissection describes what you need to do to implement custom conflict
resolutionin SQL Remote for Adaptive Server Anywhere. The concepts are
thesame in SQL Remote for Adaptive Server Enterprise, but the
implementationis different.
SQLRemote allows you to define conflict resolution triggers to handle
UPDATEconflicts. Conflict resolution triggers are fired only at a
consolidateddatabase, when messages are applied by a remote user. When
anUPDATE conflict is detected at a consolidated database, the following
sequenceof eventstakes place.
1. Any conflict resolution triggers defined for the operation are fired.
2. TheUPDATE takes place.
3. Any actions of the trigger, as well as the UPDATE, are replicated to all
remotedatabases, including the sender of the message that triggered the
conflict.
Ingeneral, SQL Remote for Adaptive Server Anywhere does not replicate
theactions of triggers: the trigger is assumed to be present at the remote
database. Conflict resolution triggers are fired only at consolidated
databases,and so their actions are replicated to remote databases.
4. At remote databases, no RESOLVE UPDATEtriggers are fired when a
messagefrom a consolidated database contains an UPDATE conflict.
5. The UPDATE is carried out at the remote databases.
Atthe end of the process, the data is consistent throughout the setup.
UPDATEconflicts cannot happen where data is shared for reading, but each
row(as identified by its primary key) is updated at only one site. Theyonly
occurwhen data is being updated at more than one site.
Using conflict resolution triggers
Thissection describes how to use RESOLVE UPDATE,or conflict
resolutiontriggers.
UPDATEstatements with
aVERIFY clause Conflictresolution triggers are fired by the failure of values in the VERIFY
clauseof an UPDATE statement to match the values in the database before
theupdate. An UPDATEstatement with a VERIFY clause takes the
followingform:
122