SqlCeReplication:在每次同步之前使用 ReinitializeSubscription?
我正在处理旧版 Windows Mobile 5 应用程序中的一个错误,该应用程序使用 SQL CE 复制将 SQL CE 数据库与 SQL Server 2005 或 2008 数据库同步(使用合并复制)。
应用程序中有一些行为我认为与该错误无关,但我很好奇它可能会产生什么副作用。该代码最终在调用 Synchronize 之前对 SqlCeReplication 对象调用“ReinitializeSubscription(true)”。 “true”标志只是告诉重新初始化在重新初始化之前上传任何更改,这很好。我不认为每次都有具体的理由重新初始化 sub,但这就是它的作用...
在每次 Synchronize 调用之前调用 SqlCeReplication 对象上的 ReinitializeSubscription 有何影响?与在 Synchronize 之前不调用 ReinitializeSubscription 相比,这只是对性能的影响,还是实际上对数据同步做了一些不同的事情?
I'm working on a bug in a legacy Windows Mobile 5 app, which uses SQL CE Replication to sync a SQL CE database with a SQL Server 2005 or 2008 database (using Merge replication).
There is some behavior in the application which I don't believe is related to the bug, but I was curious what the side-effects of it might be. The code ends up calling "ReinitializeSubscription(true)" on the SqlCeReplication object before it calls Synchronize. The "true" flag just tells the reinit to upload any changes before reinitializing, which is fine. I don't believe there is a concrete reason to reinit the sub each time, but that's what it does...
What is the impact of calling ReinitializeSubscription on the SqlCeReplication object before each Synchronize call? Is it just a performance hit, or is it actually doing something different with the data synchronization, compared to not calling ReinitializeSubscription before Synchronize?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除非您遇到重大客户端问题,否则不要每次同步时都重新启动,这将下载整个客户端数据库(上传更改后),并消耗时间和带宽,并提供较差的用户体验(除非您的数据集非常小并且当然,你有高带宽)
Unless you are experiencing major client íssues, do not reinit each time you sync, that will download the entire client database (after uploading changes), and consume time and bandwidth, and give a poor user experience (unless you data set is very small and you have high bandwidth, of course)