none
SetPopulateTrackingTableDefault not sync updates RRS feed

  • Question

  • Hello this should be a basic SqlSyncProvider SYNC question.  Updates are not synchronized. Do you need to fill   all the tracking data into the tracking tables, at the scope creation, for updates to work?

    1. DB has records, for example 1000 Records in table customer

    2. We provision the sync tables with the options SetPopulateTrackingTableDefault(DbSyncCreationOption.Skip);

    3. There is a update to an existing customer record. Tracking information is NOT writen, over the trigger, to the tracking table customer_tracking. 

    4. we run synhronization. Get changes sp CUSTOMERS_selectchanges  is called. It returns 0 record becuse the chnage has not been inserted into the tracking table. And nothing gets synhronized.

    Is this  normal and is there any documentation? If it is  then, when exactly would you  use the SetPopulateTrackingTableDefault(DbSyncCreationOption.Skip) then? Do you need to always fll all the tracking data if you want to have whole DB in synhronization. And this opens the question of the SqlSyncStoreMetadataCleanup.RetentionDays and PerformCleanup  operation. doeas this operation clears the tracking data ? If it doues you could loose the updates then...

    Thank you for pointer into the right direction.

    Wednesday, September 12, 2012 9:55 AM

All replies

  • you should normally just leave SetPopulateTrackingTableDefault to its default setting. afaik, the sdk is smart enough to know if it needs to populate or not. an instance where you don't really want to even check if it needs to populate a tracking table is when you're provisioning another scope for a table that has been previously added and provisioned in another scope. the first scope should have populated the tracking table already, so there is no need to populate it on the second scope.

    the Metadata cleanup is for tombstone records or deleted records. there is no point keeping tracking metadata for deleted rows when you know it has long been propagated and synched to all replicas. (e.g., a delete last year would have been propagated by now).

    Wednesday, September 12, 2012 10:51 AM
    Moderator
  • Thank you for the answer.

    Im relieved then that the PerformCleanup  works as i expected. That is OK logic.

    For the  SetPopulateTrackingTableDefault(DbSyncCreationOption.Skip) i have the only problem that maybe i want a quick scope creation when the DB is LARGE and then to skip the tracking tables insert (DbSyncCreationOption.Skip) is very good.

    Im thinking of modifying the creation script of the  update trigger and inserting the extra logic of checking it the tracking information exists if not then insert into tracking table with updated flag.

    Has anyone done this before,  does it make sense to you?

    Wednesday, September 12, 2012 11:21 AM
  • personally, i'd leave the default behaviour. its not everyday you provision a scope.

    if you don't populate the tracking table and you only insert a value in the tracking table when a row is updated, what happens if its not updated? you only send it to the other replicas when its updated?

    besides, instead of paying the price of populating the tracking table during provisioning, youre now paying the price for it for every update operation you do. its an even more expensive operation since you have to query the tracking table to do the check.


    Wednesday, September 12, 2012 12:04 PM
    Moderator