Chapter 7. SQL Remote Design for Adaptive Server Anywhere

custom conflict resolution, using a trigger to resolve conflicts in a way that makes sense for the data being changed.

 

Conflict resolution does not apply to primary key updates

 

UPDATE conflicts do not apply to primary key updates. You should not

 

update primary keys in a SQL Remote installation. Primary key conflicts

 

must be excluded from the installation by proper design.

 

 

 

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

SQL Remote replication messages include UPDATE statements as a set of

detected

single row updates, each with a VERIFY clause that includes values prior to

 

updating.

An UPDATE conflict is detected by the database server as a failure of the

VERIFY clause 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. Any conflict resolution (RESOLVE UPDATE) triggers are fired.

2. The UPDATE is applied.

UPDATE statements are applied even if the VERIFY clause values do not match, whether or not there is a RESOLVE UPDATE trigger.

Conflict resolution can take several forms. For example,

In some applications, resolution could mean reporting the conflict into a table.

You may wish to keep updates made at the consolidated database in preference to those made at remote sites.

Conflict resolution can be more sophisticated, for example in resolving inventory numbers in the face of goods deliveries and orders.

The method of conflict resolution is different at an Adaptive Server Enterprise consolidated database. For more information, see “How SQL Remote handles conflicts” on page 166 .

121

Page 139
Image 139
Sybase DC38133-01-0902-01 manual How SQL Remote handles conflicts, Must be excluded from the installation by proper design