Conflicts and how they occur

A data conflict occurs when a user changes a record that has been changed by a user at a different site, within the same replication cycle.

Examples of data conflicts are:

  • Data in any field in the same entity is modified by two users, even if in different fields.

  • One user modifies a link, for example gives it a direction, but a different user deletes it.

  • One user adds a link but a different user deletes a link end entity for that link.

In normal circumstances, it is unlikely that any data conflicts occur in systems with fixed Subscribers only because changes from Subscribers are merged continuously with the Publisher and replicated to the Subscribers almost immediately.

For a conflict to arise, the first update to a record and the second conflicting update must merge with the Publisher before the Publisher can replicate the first update to the Subscribers. In this example, Sites A and B make conflicting changes to the same record:



In this example, a conflict occurs because Site B merges its change into the publication database before the Publisher can replicate the change made by Site A. The conflict is automatically resolved in favor of the first change to merge at the Publisher (Site A), and it is this record which is replicated to Site B. The outcome would be the same if Site A was actually the Publisher.

Conflicts are most likely to occur when disconnected Subscribers connect to the Publisher or when a failed communications link comes back online.

All conflicts are resolved automatically by SQL Server which replicates the modification or deletion to all sites. You need to review all the conflicts in the iBase Conflict Viewer. If required, you can change how the conflicts were resolved. Changing the outcome of a conflict updates the publication database and replicate the change to all the subscription databases.

Note: Conflicts must be reviewed before you can purge or restore soft deleted records, and before the SQL Server administrator disables replication. All conflict data is lost when replication is disabled by the SQL Server administrator.

Understanding the Conflict Viewer

Conflicts are reviewed using the iBase Conflict Viewer, in the publication database only.

The user who reviews the conflicts must decide whether to keep the "winning" record in the conflict (the record currently seen at all sites) or replace it with the "loser". When they confirm their decision, the record they choose to discard is purged from the database. Before they confirm their decision, they can edit the record they want to keep, for example, to include details from the record that is purged.

If the outcome of the conflict is changed, the records are replicated to all the subscriber sites to update the databases and produce a consistent view of the data across all the sites. If the decision is to keep the original outcome, then nothing is replicated and the databases remain unchanged because they already have the data.

The following figure summarizes the iBase Conflict Viewer. The Subscriber to merge first with the Publisher is presented as the winner, and the Subscriber to merge second is presented as the loser:



Note: The records that are displayed might contain several conflicting changes, for example to both the link direction and to a field in the link.

Note: It is important to remember the deletions and modifications that are shown in the Conflict Viewer have already taken place. The winning record is already seen at all fixed Subscribers, and at any disconnected Subscribers that are online and connected to the Publisher since the conflict was resolved. You use the Conflict Viewer to either confirm that the deletion or modification was correct, or to change the outcome.  

The different types of conflict are described in detail in the following information:

Unless otherwise stated, the examples given in the following sections apply both to a conflict automatically resolved in SQL Server or to a conflict reviewed in the iBase Conflict Viewer.

Conflicting changes to an entity

In this example, the Subscriber at Site A deletes the entity but the Subscriber at Site B changes it in some way:

  • If Site A wins the conflict, the entity is soft deleted at all Subscribers.

  • If Site B wins the conflict, the entity is updated at all Subscribers, and users at Site A see a restored entity, in its updated form.

Conflicts between three or more sites

It is possible for three or more sites to make conflicting changes to the same data. The conflicts are listed in the Conflict Viewer in the usual way (by the record label of the winning record). The second conflict that is listed in this example occurs between a third site and the "winner" of the first conflict:



Conflicts when records are deleted

Conflicts occur when users at different sites delete the same entity, link, or entity with links. Although the outcome of these conflicts is the same regardless of which site wins the conflict, you might want to investigate why users at different sites are deleting the same records.

Unsupported conflicts

Merge conflicts and a specific type of link end conflict are not supported in the Conflict Viewer.

Conflicts resulting from merging

Conflicts arising from merging entities are not supported, and cannot be viewed in the Conflict Viewer. You need to set up a procedure to prevent these conflicts from arising. See Merging Entities for working practices.