简体   繁体   English

在合并复制中如何处理这种情况

[英]how will this situation be handled in merge replication

  • there is a time slot table. 有一个时隙表。
  • it exists on two or more computers. 它存在于两台或更多台计算机上。

the table maintains the reservation of the time slot for the complete year. 该表保留了整个一年的时隙保留。

assume that the connection between the servers breaks. 假设服务器之间的连接断开。

user on site1, site1上的用户,

enters data like :-- timeslot(3:8) reserved for(this) where timeslot is the primary key 输入像这样的数据:-为(this)保留的时隙(3:8),其中时隙是主键

user on site2 网站上的用户2

does the same. 一样。

problem 问题

the dbms will give no error as, the change at site1 is not recorded/replicated to the site 2 dbms不会给出错误,因为未记录site1上的更改/未将其复制到site 2

when the connection between the sites is restablished, there will be an error when the merging of sql sever runs AT BOTH ENDS. 当站点之间的连接重新建立时,sql服务器的合并在两端运行时将出现错误。

how will this error be handled by the sql server AT BOTH SITES? sql server在两个站点如何处理此错误? what data of which site will it allow? 它将允许哪个站点的哪些数据?

In merge replication you have conflict detection and resolution, which addresses your scenario. 在合并复制中,您可以使用冲突检测和解决方案来解决您的方案。 You can configure replication to handle this situation based on how you need the conflict to be resolved. 您可以配置复制以根据需要解决冲突的方式来处理这种情况。

There are a few ways to set up replication to handle this. 有几种方法可以设置复制来处理此问题。 You may want the problem resolved by indicating that the first user to make the change is the winner. 您可能希望通过指示第一个进行更改的用户是获胜者来解决问题。 Or, you may want to prioritize the subscriptions. 或者,您可能要优先考虑订阅。 For example, site 2 could have a higher priority and the change at site 2 would win in your scenario. 例如,在您的方案中,站点2的优先级可能更高,而站点2的更改将获胜。 You can also define your own conflict resolution rules through managed code or COM-based code. 您还可以通过托管代码或基于COM的代码定义自己的冲突解决规则。

Here are a couple of links with more information. 这里有一些带有更多信息的链接。
How Merge Replication Detects and Resolves Conflicts 合并复制如何检测和解决冲突
Advanced Merge Replication Conflict Detection and Resolution 高级合并复制冲突检测和解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM