locked
Is there any method in Sync Framework 2.1 providers to return last_change_datetime from tracking tables on conflict RRS feed

  • Question

  • I've built a n-tier Sync application based on the Sync FW sample for n-tier with WCF proxy.  I've added a lot of functions and everything works as expected.  Using SQL Server 2012 and SQL Express 2008.  I've defined 10 Scope sets each with about 10 tables in them.  I'm trying to add some custom conflict handling and can catch the conflicts and log to a table for review and mark which one should win the conflict.  However I can't see a way to determine if the client update or the server update should win based on the data that is returned with the conflict.  I get the row data as well as the "sync_create_peer_key, sync_create_peer_timestamp, sync_update_peer_key, sync_update_peer_timestamp" which don't really help in the who should win decision.  I don't want to update the original date time stamp in the tables when an update is made.  I would like to use the "last_change_datetime" from the tracking table or something similar from the sync provider.  I could do it by a query from my application to the database, but it looks like there should be some method in the sync operation I could get this information from.  I just can't seem to figure it out.  I guess worst case I could add a date time column to each table that would hold the last update date and time but I would prefer not to.  The ISupportLastWriteTime interface looked promising but doesn't appear to be implemented in FW 2.1.  Any suggestions would be greatly appreciated.
    Saturday, May 3, 2014 3:40 AM

Answers

  • unfortunately, Sync Fx do not record the last update time for the changes. the easiest workaround if you want to use last update time for conflict resolution is to have a last update time column on the table you're synching. you can then compare source and destination last update time in the conflicting rows themselves
    • Marked as answer by KevinTK Thursday, May 8, 2014 11:48 PM
    Thursday, May 8, 2014 1:57 PM

All replies

  • unfortunately, Sync Fx do not record the last update time for the changes. the easiest workaround if you want to use last update time for conflict resolution is to have a last update time column on the table you're synching. you can then compare source and destination last update time in the conflicting rows themselves
    • Marked as answer by KevinTK Thursday, May 8, 2014 11:48 PM
    Thursday, May 8, 2014 1:57 PM
  • Thank you very much for the answer.  That is what I ended up doing.  I've read many of your answers on the forum and you always provide clear answers. 
    Thursday, May 8, 2014 11:48 PM