问题
I am trying to implement unidirectional sync from Server to Client, both running SQLExpress 2008 using Sync Framework 2.1. I'm having trouble during initial sync.
Two scopes are defined on the server:
Scope1 contains tables A, B, C and Scope2 contains tables B, C, D
Before the initial sync, the client database contains tables A, B, C and D (imported using a script), and each table is empty. Database has been provisioned using the server's scope information for Scope1 and Scope2, using default provisioning settings.
When syncing Scope1 for the first time, everything succeeds. When syncing Scope2, every record for shared tables (B, C) is being downloaded and reported as a LocalInsertRemoteInsert
conflict.
Is there a way to avoid such behavior? Shouldn't Sync Framework know, after Scope1 is done syncing, that tables B and C are now up to date?
回答1:
you have overlapping scopes where data contained in the other scope is the same data that falls in the other scope.
information on what was synched is stored at the scope level, what was synched on first scope is not known to the second scope and vice versa.
when you sync Scope 1, it downloads data and updates its own sync knowledge on what was synched. When you synch Scope 2, it has no idea of what Scope 1 has synched, so it downloads them again.
i would put B and C on Scope 1 and create Scope 2 on A, Scope 3 on D. so you only synch B and C once.
来源:https://stackoverflow.com/questions/12841460/localinsertremoteinsert-conflicts-on-initial-sync