同步框架:SqlSyncProvider ItemConflicting 与 ApplyChangeFailed
我正在尝试设计一个同步应用程序来同步不同 SQL Server 数据库之间的更改。
我提出了一个基于接收 ItemConflicting 事件、存储与冲突相关的知识以及离线解决所有冲突的设计。
但是,似乎我只能触发 ApplyChangeFailed 事件。 SqlSyncProvider 不使用 ItemConflicting 事件是否有某种原因?我只是错误地连接了该事件吗?
我关心的原因是 ItemConlficting 事件允许我简单地记录冲突并以我似乎无法通过 ApplychangeFailed 事件实现的方式继续同步的其余部分。
I'm trying to use design a syncronisation application that syncs changes between different SQL Server databases.
I came up with a design based around receiving the ItemConflicting event, storing the knowledge associated with the conflict, and resolving all conflicts off-line.
However, it seems that I can only get the ApplyChangeFailed event to fire. Is there some reason why SqlSyncProvider does not use the ItemConflicting event? Am I just hooking up to the event wrongly?
The reason I care is that the ItemConlficting event allows me to simply log the conflict and continue with the rest of the synchronisation in a way that I can't seem to achieve with the ApplychangeFailed event.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
引发ApplyChangeFailed只是为了指示冲突或错误,无论您是通过解决或指定哪一行应该胜出还是忽略它来解决冲突,您都应该能够继续同步过程。
不确定存储“知识”是什么意思,您指的是同步知识还是指冲突的行?
如果您需要的话,ApplyChangeFailed 事件参数具有访问冲突行的属性。然后您可以拦截冲突行,然后将ApplyAction设置为继续或RetryNextSync
the ApplyChangeFailed is simply raised to indicate a conflict or an error, whether you address the conflict by resolving or specifying which row should win or ignoring it, you should be able to continue with the sync Process.
not sure what you mean by storing the "knowledge", are you referring to sync knowledge or are you referring to the conflicting rows?
the ApplyChangeFailed event parameter has properties to access the conflicting rows if that's what you need. you can then intercept the conflictign rows, then set the ApplyAction to continue or RetryNextSync