sql-server-2008-r2microsoft-sync-framework

How to make MS SYnc Fx 2.1 resume from the point where it left during database syncup?


I have used Batching method in my database sync code using MS Sync Fx 2.1. Now when I was syncing a huge table, I intentionally killed the process in the middle and that time it was synced around 45% of the data from master database. (This is a initial data sync). It means client database has the empty table, and the sync process created related scope info and all and then stated syncing data.

Now, I just restarted the sync process, and its not syncing from the point it left. In order to achieve this, do I need to do any extra coding other than just enabling batching?


Solution

  • Batching in Sync Framework is actually more for controlling the memory footprint when transmitting changes to the destination. If you have 10mb worth of changes and you specified 1mb batches, it serializes the changes in 1mb batches.

    These batches are spooled on the destination and applied. However, all batches are applied in a single transaction, so even if 5/10 batches has been applied already, it has not been committed.

    The resume capability is in the change enumeration, not change application. Assuming 5/10 batch has been sent already, then it will resume sending the remaining 5, but the 10 batches will still belong to a single transaction.