How to make SyncFramework realise items are different if the Ids are the same on heterogenous schema RRS feed

  • Question

  • Hi, I posted a while ago about Sync Frameworks suitability for merging data between heterogenous schema. My situation is that I have 18 databases, that we can call clients, and one master database i want to sync changes to.

    The master and client schemas are identical except the all tables in the master have an extra column - ClientId, to indicate which client the data came from.

    I have written my own custom provider that works ok if all the Id fields are unique (as expected). In the public void SaveItemChange(SaveChangeAction saveChangeAction, ItemChange change, SaveChangeContext context){} method, i am adding ClientId to the incoming item before saving it to the master. This works fine, but if a an item coming from ClientA has Id 1, and Id1 is not in the master, the item is stored successfully with a Client Id of A. However, if an item then comes from ClientB also has Id1 also, sync framework tries to overwrite the old Id1. Instead I would like to add this as a new row, with the same Id and a Client Id of B. I cannot modify the client schemas in anyway, but I can add new databases if required.


    Is this even possible or am I trying to use Sync Framework for what it wasnt intended?

    Thursday, July 29, 2010 11:29 AM

All replies

  • Ok, I attempted to change the calls where I am saving the metadata by having a custom ID which is ID_ClientId, and when the metadata is pulled out, I am changing the Item change ID back from ID_ClientId. Howevber I keep getting a "syncSessionContext.ForgottenKnowledgeRecoveryRangeLowerBound' threw an exception of type 'Microsoft.Synchronization.SyncIdFormatMismatchException" when I try to set my currentSessionContext in the public override void BeginSession(SyncProviderPosition position, SyncSessionContext syncSessionContext).


    Any ideas how I can fix this?

    Thursday, July 29, 2010 12:16 PM
  • Ok, I have changed my solution a bit....I am using the standard SqlSyncProvider on the client side, but on the Master side I want to intercept the metadata and store it as itemId_ClientId....I need some sort of mapping service to do this, but am not sure if it is even possible due to the nature of Metadata.


    Can anyone help?

    Thursday, July 29, 2010 1:42 PM