问题
I am using sync framework 2.1.
What i am doing is changing the directions of sync continously
Example. first i set bidirectional, then may be upload and then download.
I am creating new scopes whenever any change happend and deprovision existing scope.
Now- After i set bidirectional and then upload direction - upload does not work at all. After then i change it to bidirection then all the changes on local is overriden by server.
While uploading all the records are conflicted with LocalInsertRemoteInsert
There are also no scope overlapping as i found there are no scopes for this table in scope_info
I also referred this LocalInsertRemoteInsert conflicts on initial sync
Any help is appreciated
回答1:
if you previously provisioned and synched the databases, then each copy contains data already. when you deprovision, Sync Fx removes the sync metadata including information on what was previously synched but not the data itself.
so when you reprovision and try to sync, since the previous information on what was synched was already wiped out by deprovisioning, Sync Fx has no idea that the replicas already contains the same set of rows.
when you sync, it will try to send the rows from one replica to the other, since the data already exists on the other side, you get a conflict (a duplicate PK error when inserting rows).
来源:https://stackoverflow.com/questions/13320744/localinsertremoteinsert-error-in-syncframework-2-1-when-changing-directions