同步框架:SqlSyncProvider ItemConflicting 与 ApplyChangeFailed

发布于 2024-08-29 11:04:04 字数 303 浏览 3 评论 0原文

我正在尝试设计一个同步应用程序来同步不同 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦毁影碎の 2024-09-05 11:04:04

引发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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文