Conflictsdo not apply to
primary keys UPDATEconflicts do not apply to primary key updates. If the column being
updatedis a primary key, then when the update from User 2 arrives at the
consolidateddatabase, no row will be updated.
Thissection describes how you can build conflict resolution into your
SQLRemote installation at the consolidated database.
How SQL Remote handles conflicts
Whena conflict is
detected SQLRemote replication messages include UPDATE statements as a set of
singlerow updates, each including the values prior to updating.
AnUPDATE conflict is detected by the database server as a failure of the
valuesto match the rows in the database.
Conflictsare detected and resolved by the Message Agent, but only at a
consolidateddatabase. Whenan UPDATE conflict is detected in a message
froma remote database, the Message Agent causes the database server to
taketwo actions:
1. TheUPDATE is applied.
2. Any conflict resolution procedures are called.
UPDATEstatements are applied even if the VERIFY clause values do not
match,whether or not there is a resolve update procedure.
Themethod of conflict resolution is different at an Adaptive Server
Anywhereconsolidated database. Formore information, see “How SQL
Remotehandles conflicts” on page 121.
Implementing conflict resolution
Thissection describes what you need to do to implement custom conflict
resolutionin SQL Remote.
Requiredobjects Foreach table on which you wish to resolve conflicts, you must create three
databaseobjects to handle the resolution:
Anold value table Tohold the values that were stored in the table
whenthe conflicting message arrived.
Aremote value table Tohold the values stored in the table at the
remotedatabase when the conflicting update was applied, as determined
fromthe message.
Astored procedure Tocarry out actions to resolve the conflict.
Theseobjects need to exist only in the consolidated database, as that is where
conflictresolution occurs. Theyshould not be included in any publications.
166