locked
When the data to be synced is a big chunck, will SyncFx continuously sync until all data is synced? RRS feed

  • General discussion

  • For a particular system, when the sync size is limited to 2 MB and there are 10 MB to sync, will the sync task continuously working until all data is synced or will it stop after 2 MB is synced and then wait for the next sync cycle?

    I'm having some problem with data integrity: a transaction has multiple rows in the database. During the synchronization, the different rows were synced to the Master database at different time. When we tried to generate some results from these data on Master database, the results were incorrect. How do we prevent this from happening?

    Tuesday, June 5, 2012 9:05 PM

All replies

  • how are you limiting the sync to 2mb? are you referring to the built-in batching?

    if yes, then batching only applies to the transmission of the changes, all of the batches in a sync session are still part of a single transaction. so in a 10mb changeset, batched into 2mb increments, the 5 x 2mb increments are all part of the same transaction.

    you might want to check ApplyChangesFailed event instead to see if there are conflicts/errors encountered when applying the changes.

    Wednesday, June 6, 2012 12:01 AM
  • We're logging the statistics. However, we've not seen any failure in applying the changes, at least not during the period of time when we had the problem.

    But we've seen some evidence that two rows for the same transaction were synced to the Master database in two different cycles. The records indicated the two rows were inserted into the database with a few seconds of difference only. So, it's just coincident that these two rows were not selected in the same sync cycle?

    Wednesday, June 6, 2012 3:34 PM
  • it could be that the selectchanges sp is already done selecting the rows when the other row was inserted. note that Sync Fx is setting Snapshot Isolation level for the transaction isolation level
    Wednesday, June 6, 2012 11:52 PM
  • Is there a way to let the SyncFx to know that some rows need to be selected together?
    Thursday, June 7, 2012 1:49 AM
  • the change selection is based on incremental changes  or what has changed since the last sync, Sync Fx doesnt really know (or care) about the relationship between rows...

    a scope is the what determines what needs to be synched together in a transaction (which tables and columns and which rows that satisfies a filter)

    Thursday, June 7, 2012 2:19 AM
  • Ok. Thanls a lot!
    Thursday, June 7, 2012 11:54 AM
  • After looking into additonal log traces, we did see exception during the application of the changes by the SyncFx. Does the SyncFx have retry mechanism? Can we ask the SyncFx to retry if we find out any error happened?
    Wednesday, June 13, 2012 9:16 PM
  • subscribe to the ApplyChangesFailed event, check the error/conflict from there and set the conflict resolution...

    see: How to: Handle Data Conflicts and Errors for Database Synchronization (SQL Server)

    Wednesday, June 13, 2012 11:38 PM