Sybase SQL Remote DC38133-01-0902-01 User Manual

Page of 485
Conflicts do not apply to
primary keys
UPDATE conflicts do not apply to primary key updates. If the column being
updated is a primary key, then when the update from User 2 arrives at the
consolidated database, no row will be updated.
This section describes how you can build conflict resolution into your
SQL Remote installation at the consolidated database.
How SQL Remote handles conflicts
When a conflict is
detected
SQL Remote replication messages include UPDATE statements as a set of
single row updates, each including the values prior to updating.
An UPDATE conflict is detected by the database server as a failure of the
values to match the rows in the database.
Conflicts are detected and resolved by the Message Agent, but only at a
consolidated database. When an UPDATE conflict is detected in a message
from a remote database, the Message Agent causes the database server to
take two actions:
1. The UPDATE is applied.
2. Any conflict resolution procedures are called.
UPDATE statements are applied even if the VERIFY clause values do not
match, whether or not there is a resolve update procedure.
The method of conflict resolution is different at an Adaptive Server
Anywhere consolidated database. For more information, see
Implementing conflict resolution
This section describes what you need to do to implement custom conflict
resolution in SQL Remote.
Required objects
For each table on which you wish to resolve conflicts, you must create three
database objects to handle the resolution:
An old value table
To hold the values that were stored in the table
when the conflicting message arrived.
A remote value table
To hold the values stored in the table at the
remote database when the conflicting update was applied, as determined
from the message.
A stored procedure
To carry out actions to resolve the conflict.
These objects need to exist only in the consolidated database, as that is where
conflict resolution occurs. They should not be included in any publications.
166