So,
We have a scenario that requires a level of "conflict resolution" that is not readily explained in all the Replication Documentation on MSDN (or at the very least is not easily found).
So far I have found the EnumMergeConflictCounts() and EnumConflictTables() on the ReplicationDatabase class in the SMO/RMO libraries. (I know this I primarily RMO but it is dependent on SMO). These are great in telling me what articles had conflicts, and an initial entry point to discovering what the conflicts are should I wish to proceed further. However, this seems pretty much only that amount of information (no more) and if I want more I have to go to the specific MSMerge_conflict* tables for the indicated articles to get what the conflicts where. (I maybe wrong, so please feel free to correct).
The problem we have is such:
Much of our system is based on Audit tracking, and thus we utilize 1-1 style Junction Tables. To elucidate further:
Cabinets, Televisions, Cabinet_Television. Televisions is only the list of the types of Televisions, and Cabinets is the list of the physical Cabinets. Cabinet_Television retains a link to both tables with an Installed and Removed date columns respectively.
The Cabinet_Television record that is Installed but with a REmoved of NULL is the current Television in the cabinet. If they install a different Television, the current Cabinet_Television record has it's "Removed" column assigned and a New
Cabinet_Television record is created pointing with a REmoved of NULL.
Generally straight forward system (and we have this scenario in Multiple places throughout our database schema).
However, as you can guess, if two "subscriber" systems, which are not currently connected to the Publisher's network, will be able to "install" the same Television in the same Cabinet. (or perhaps different Televisions in the same Cabinet) and on their independent database they will generate unique Cabinet_Television records. Upon synchronization, they end up with two televisions installed in the same Cabinet at the same time, which is invalid.
Now, granted, this is a business logic decision that we have to come up with our own solution, which may or may not include an interactive "resolver" for the User of our application. However, it is the nature of how to do this resolution that has got me baffled. I can use the EnumMergeConflictCounts() to detect conflicts, and/or using the EnumConflictTables() to get where the conflicts exist, but I have not seen any RMO (or SMO, though unlikely for this scenario) methods or classes that would allow for the following:
- Retrieve per ArticleConflict object the list of actual Conflicts.
- Once the User selects the "Winner" to instruct the PUblisher/Publication with the "correct" value.
- Remove the Conflict record and "mark as resolved".
I realize, that for our system with these junction tables, we will need to handle the business logic ourselves in adjust our data with respect to the duplicate or additional "invalid" junction record and remove it or update it as necessary, but the resolution on the side of SQL Replication with changing the winner, and marking the conflict resolved is currently a mystery to me.
Thanks
Jaeden "Sifo Dyas" al'Reac Ruiner
"Never Trust a computer. Your brain is smarter than any micro-chip."
PS - Don't mark answers on other people's questions. There are such things as Vacations and Holidays which may reduce timely activity, and until the person asking the question can test your answer, it is not correct just because you think it is. Marking it
correct for them often stops other people from even reading the question and possibly providing the real "correct" answer.