SyncAgent and synchronization direction RRS feed

  • Question

  • Please advice, can I somehow use Microsoft.Synchronization.SyncDirectionOrder enumeration in SyncAgent class? I want somehow to configure this class to use 'DownloadAndUpload' enum value for handling conflicts on client side. Or I must use only SyncOrchestrator class for this task? 
    Sunday, April 25, 2010 7:56 PM


All replies

  • My main task is to set up synchronization of MS SQL Server 2008 and multiple desktop applications with SQL Sever Compact Edition 3.5 throw WCF services. We choose MS Sync Framework 2.0 (Synchronization Services) for ADO.NET for implementing this task. I use auto-generated classes (adapters, providers and SyncAgent) by Visual Studio 2008 "Synchronization" master. But I have a problem with resolving conflicts (ClientUpdateServerDelete / ClientDeleteServerUpdate / ClientUpdateServerUpdate) on the client side. I want to handle ApplyChangeFailed event on the client side to give user an opportunity to choose a part of his conflicting changes to apply and to choose which changes must be canceled. But I can't handle this event on the client. I suppose that changing SyncDirectionOrder to 'DownloadAndUpload' helps me...
    Sunday, April 25, 2010 8:23 PM
  • pls follow the steps here for changing the VS 2008 designer generated code to use BiDirectional sync : http://blogs.msdn.com/sync/archive/2008/06/16/extending-visual-studio-2008-sp1-sync-designer-to-support-bi-directional-synchronization.aspx

    The ApplyChangeFailed event is fired separately for the local provider and the remote provider. So, if you're using WCF for the remote provider, you have to code your WCF service to propagate the ApplyChangeFailed event back to the client (callbacks?).



    • Marked as answer by _Case Monday, April 26, 2010 7:03 PM
    Monday, April 26, 2010 2:32 AM
  • JuneT, thank you for your response!

    I solve this problem by calling SyncAgent.Synchronize() method twice. First with SyncDirection.DownloadOnly and the second with UploadOnly direction. During the first Synchronize() call I can handle now ApplyChangeFailed events on the client.

    Monday, April 26, 2010 7:03 PM