none
Sync Framework version is 1.0 SP1 fails to upload changes. How to debug? RRS feed

  • Question

  • Hi,

     

    We have a Sync Framework based project created by VS 2010 Local Database Cache Wizard. Local DB is SQL Server Compact 3.5 SP2, remote is SQL Server Express 2008. Sync Framework version is 1.0 SP1

     

    After we enter some information in the local db (.sdf) and try to sync SyncStatistics syncState = syncAgent.Synchronize(); does not throw any exception, but some of the tables get updated while others did not.

    In syncState we can see TotalChangesUploaded=8, UploadChangesApplied=1, UploadChangesFailed=7

     

    How do we discover what exactly changes failed to upload, why they failed to upload and who to fix it?

     


    Thank you! Konstantin

    Wednesday, July 28, 2010 10:35 PM

Answers

  • You can subscribe to the ApplyChangeFailed event and see whether there's an error or a conflict.

    Wednesday, July 28, 2010 10:53 PM
    Moderator

All replies

  • You can subscribe to the ApplyChangeFailed event and see whether there's an error or a conflict.

    Wednesday, July 28, 2010 10:53 PM
    Moderator
  • After some hops I managed to subscribe to the ApplyChangeFailed event on the server side and figured that insertions fail because of some foreign key conflicts which is probably caused by the tables updated in the wrong order.

    How can I control the order in which tables are synchronized?

     


    Thank you! Konstantin
    Thursday, July 29, 2010 1:32 AM
  • Check the order in the way the tables are added in the SyncTable collection. If you're using the Local Database Cache wizards, make sure the parent tables is listed before the child tables.
    Thursday, July 29, 2010 2:24 AM
    Moderator