Merging entities
The Conflict Viewer, handles conflicting changes to entities and their links that arise from direct editing or deleting of the records; it does not handle conflicts that arise from merging entities or occurring in the records affected by a merge operation. A typical example of this type of conflict is someone edits a link that is deleted as a result of a merge performed at a different site.
About this task
- Only authorized users can access the Merge Entities options.
- You need to establish a procedure for reviewing and merging entities so that only one user at a time merges entities, preferably using the publication database.
- You need to review any existing procedures that might add to the number of duplicates in the system.
It is important to restrict who has access to Merge Entities This ensures that only users who understand the impact of merging entities on a replicated database have authority to perform this operation.
The objective of this procedure is to ensure that only one user at a time merges entities to prevent merge conflicts from arising in the first place.
Each site needs to appoint a senior analyst with responsibility for carefully analyzing the records involved in a merge. Depending on the procedure, they might have permission to also perform the actual merge, or you might choose to restrict this to a single user account.
A senior analyst at each site must carefully analyze the records involved in the proposed merge. There are various ways of organizing this. For example, if you want to use iBase to manage this, a possibility is to define a Merge Request entity type in your database schema, which would contain the information that relates to the merge, and use this as a way of reviewing and getting agreement on the decision to merge.
The procedure would be, for example:
Procedure
What to do next
- Designing a Merge Request entity type
-
For information on what to consider to design a suitable entity type for Merge Requests, see Updating the Database Design.Note: Adding a Merge Request entity type is a change to the database schema and must be done before the publication database is configured for replication in SQL Server or when replication is disabled in SQL Server.
- How are duplicate records created at the moment?
-
Consider whether there is any scope within your current working practices to reduce the number of duplicate records that are added to the system. For example:
- Are users importing data that contains duplicates and then using merge to remove the duplicates? In this case, consider how you might clean your data before you import it into a replicated database.
- Check that you have discriminators set on all your entity and link types to prevent users from accidentally entering duplicates.
- Avoid performing batch edits, especially on discriminator fields.
- What to do if a conflict occurs
-
A typical conflict that arises from a merge is, for example, someone edits a link or entity before someone else performing a merge in which the entity or link is deleted. The iBase Conflict Viewer cannot display the context in which this conflict arose, and it is not possible to use the Conflict Viewer to restore it to its original state.
In this situation, the best course of action is to use the chart that contains the pre-merge data to recreate any missing data. It is also possible that your SQL Server administrator might be able to use an SQL Server Conflict Resolver to restore some of the data.
To avoid this situation from arising in the future:- Always chart the data to Analyst's Notebook and then save a chart before a merge— this gives you the opportunity to recreate the data if you discover a problem.
- Do not merge if any Subscribers are offline.