locked
How to synchronize relational data bases with Sync Framework? RRS feed

  • Question

  • Hi,
      I´m working with relational databases that are being synchronized using sync framework 2.0. The problem is that when i synchronize i´m getting errors due to the dependency that the relational database creates between the tables. Is there a way to set a synchronization order on the database tables?

    Thanks in advance.
    Paola
    • Moved by Sean_KelleyModerator Wednesday, September 9, 2009 3:46 AM (From:SyncFx - General)
    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:37 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, September 3, 2009 12:38 PM

Answers

  • Paola,

    If you are using SqlSyncProvider the order is not exposed through SyncAdapters.  Rather, the order is defined by the way you add the tables to your scope when provisioning.  As such, you should order the tables to address any foreign key dependencies. 

    Regards,
    Sean Kelley
    Senior Program Manager
    Microsoft
    Sunday, September 13, 2009 10:25 PM
    Moderator

All replies

  • Are you using Sync Services for ADO.NET or do you have a custom provider?
    Thursday, September 3, 2009 9:57 PM
    Moderator
  • I´m using the provider for sql server EXPRESS that is available in sync Framework 2.0
    Tuesday, September 8, 2009 7:07 PM
  • The synchronization order is the order of:

    - SyncAdapters added into xxxSyncProvider.SyncAdapters at server.
    - SyncTables added into SyncAgent.Configuration.SyncTables at client.

    Normally they should be the same order.

    Wednesday, September 9, 2009 11:16 PM
  • Paola,

    If you are using SqlSyncProvider the order is not exposed through SyncAdapters.  Rather, the order is defined by the way you add the tables to your scope when provisioning.  As such, you should order the tables to address any foreign key dependencies. 

    Regards,
    Sean Kelley
    Senior Program Manager
    Microsoft
    Sunday, September 13, 2009 10:25 PM
    Moderator
  • Hi,
       Yes I´m using SqlSyncProvider so i´ll try by re initializing the sincronizer taking into account the order of the tables.

    THANKS!!
    Paola
    Monday, September 14, 2009 1:15 PM
  • Hi Sean,
       This definetly seems to work :)

    Thanks very much!!
    Paola
    Tuesday, September 15, 2009 12:42 PM
  • Hi,
       I have changed the scope initialization in order to specify the sync order of the tables, according to the dependencies between FKs, as suggested above. Currently, the synchronizer works OK while inserting data since the sync order of the tables was specified according to that. But, now happens that on DELETE statements this order is exactly the opposite one. I supposed that once given the order according to INSERT statements, the synchronizer could realize by itself the order in case of the DELETE statements, but it seems it is not the case. My question is if there is a way to avoid this conflict. I mean, I see that giving the order of the tables only solved part of the problem.

    Thanks in advance,
    Paola
    Tuesday, November 17, 2009 5:51 PM
  • Hi, please read this:
    http://social.microsoft.com/Forums/en-US/syncgeneral/thread/eaa89c99-7f9b-4df0-844e-cde1750f98e4
    Wednesday, November 18, 2009 9:10 AM