locked
Check if Database Structure is valid RRS feed

  • Question

  • Hello,

    my synchronisation process (Sync via .NET WebSerbice and WM2005/6.1 cliens) generates a new database as sdf on the clients,
    if no database is found.

    If a database is found but the structure is different (e.g. if I had a bad initial sync before or made structure changes after an update),
    then I am getting an exception because of an invalid datastructure.

    I am sure many others of you know this exception.
    How do you handle this?

    My plan is to copy the old invalid sdf database to an backup folder and create a new one including sending a Warning message.

    Is this a good solution?

    What is the best solution/ method to check if a sdf-structure is valid without running into that exception first?


    Regards,

    Martin
    • Moved by Hengzhe Li Friday, April 22, 2011 2:51 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, June 30, 2009 3:50 PM

Answers

  • Martin,

    In general we have veered away from schema validation within the sync runtime.  This is primarily due to the fact that the Sync Framework is store agnostic and attempting to validate schemas across all of the different store types becomes an intractable problem.  That said, we do provide the necessary eventing to perform this validation yourself if need be.  Another option you might want to think about is streaming the SDF file down on intitial sync vs creating from scratch.  This mitigates the likelihood that any mismatches between client and server will occur.  Typically developers will perform full initialization on an app server and then expose a special web service to download that .sdf file.  We added a feature called snapshot initialization in SyncFx v2 ctp2 to make this task easier and code samples can be found here:

    http://msdn.microsoft.com/en-us/library/dd918709(SQL.105).aspx

    Hope this helps,

    Sean Kelley
    Program Manager
    Microsoft

     

     

     

    • Marked as answer by macap Thursday, July 2, 2009 10:01 AM
    Thursday, July 2, 2009 12:54 AM
    Moderator

All replies

  • Martin,

    In general we have veered away from schema validation within the sync runtime.  This is primarily due to the fact that the Sync Framework is store agnostic and attempting to validate schemas across all of the different store types becomes an intractable problem.  That said, we do provide the necessary eventing to perform this validation yourself if need be.  Another option you might want to think about is streaming the SDF file down on intitial sync vs creating from scratch.  This mitigates the likelihood that any mismatches between client and server will occur.  Typically developers will perform full initialization on an app server and then expose a special web service to download that .sdf file.  We added a feature called snapshot initialization in SyncFx v2 ctp2 to make this task easier and code samples can be found here:

    http://msdn.microsoft.com/en-us/library/dd918709(SQL.105).aspx

    Hope this helps,

    Sean Kelley
    Program Manager
    Microsoft

     

     

     

    • Marked as answer by macap Thursday, July 2, 2009 10:01 AM
    Thursday, July 2, 2009 12:54 AM
    Moderator
  • Hi Sean,


    thank you very much. I´ll try CTP2.
    Is there any instruction with hints how to update from CTP1 to CTP2?


    Regards,

    Martin
    Thursday, July 2, 2009 10:02 AM
  • Unfortunately, not at this time although we will have something when we RTM.  My guidance would be to drop your sync metadata on the server and re-provision.  For the client, I would recommend that you re-init.

    Regards,

    Sean Kelley
    Program Manager
    Microsoft

     

    Thursday, July 2, 2009 8:37 PM
    Moderator