locked
Question about Sync Services Workflow RRS feed

  • Question

  • Hello,

    I have a question about the flow of events in the sync services in case of a bi-directional synchronization:-

    I want to execute some custom logic on the client just before the sync takes place. The custom logic includes deleting certain records on client and inserting those on server (which we are currently doing using a custom web service)

    Having read about the architecture of the synchronization services, it seems there are couple of events like SelectingChanges on the Client and Server Synchronization Provider that I can use to execute my custom logic. However I am not clear which of these is fired first. The documentation says that Sync Agent first calls the Client Synchronization Provider to retrieve changes made at the client and apply incremental changes at the client. I am confused as to how can incremental changes be applied from the server to client by the client synchronization provider unless the server synchronization provider collect the incremental changes at the server.

    I would appreciate if someone can suggest a better approach and clarify the workflow.

    Thanks

    Apurva
    • Moved by Max Wang_1983 Friday, April 22, 2011 6:30 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Wednesday, August 13, 2008 5:43 PM

Answers

  • Hello,

     

    If you do bi-directionly sync, the Upload sync goes first and then followed by the Download sync.

    During upload sync, we need to enumerate client change, so we have,

    ClientProvider: SelectingChanges (begin enum) and ChangesSelected (end enum).

    Then these changes are sent to the server, so we have

    ServerProvider: ApplyingChanges (begin change apply) and ChangesApplied (end change apply).

     

    During the download, the sync service will enumrate changes from the server and then apply on the client.  Similarly we have

    ServerProvider: SelectingChanges (begin enum) and ChangesSelected (end enum). and then

    ClientProvider: ApplyingChanges (begin change apply) and ChangesApplied (end change apply).

     

    Thanks.

    Wednesday, August 13, 2008 9:26 PM
    Answerer

All replies

  • Hello,

     

    If you do bi-directionly sync, the Upload sync goes first and then followed by the Download sync.

    During upload sync, we need to enumerate client change, so we have,

    ClientProvider: SelectingChanges (begin enum) and ChangesSelected (end enum).

    Then these changes are sent to the server, so we have

    ServerProvider: ApplyingChanges (begin change apply) and ChangesApplied (end change apply).

     

    During the download, the sync service will enumrate changes from the server and then apply on the client.  Similarly we have

    ServerProvider: SelectingChanges (begin enum) and ChangesSelected (end enum). and then

    ClientProvider: ApplyingChanges (begin change apply) and ChangesApplied (end change apply).

     

    Thanks.

    Wednesday, August 13, 2008 9:26 PM
    Answerer
  • Thank you so much!! That piece of information is very helpful.

    Apurva
    Thursday, August 14, 2008 1:07 PM
  • I am glad to see it helps you.  Plesae make my previous posting as "it is helpful".  Thanks.

    Thursday, August 14, 2008 4:24 PM
    Answerer