locked
SyncServicesForDevices - Changing to SyncDirection.UploadOnly RRS feed

  • Question

  • Hello there

    For the SyncServicesForDevices example, what is required to get this to work with SyncDirection.UploadOnly ? I've tried making this change and the changes would upload only initially but not on subsequent requests.

    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:48 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, October 22, 2009 10:02 PM

Answers

  • Hi,

    If I'm not wrong SyncServicesForDevices uses GetUTCDate() function to retrieve the anchor. Check both server and client has the same Time Zone. Maybe the first sync is running because of the initial sync session variable is set to 1.

    Tell us the results,,,

    Cheers,

    José Miguel Torres
    Friday, October 23, 2009 1:54 PM

All replies

  • Hi,

    If I'm not wrong SyncServicesForDevices uses GetUTCDate() function to retrieve the anchor. Check both server and client has the same Time Zone. Maybe the first sync is running because of the initial sync session variable is set to 1.

    Tell us the results,,,

    Cheers,

    José Miguel Torres
    Friday, October 23, 2009 1:54 PM
  • Hi Jose,

    I have the same Time Zone on both. The following is what I did to reproduce the problem:

    1) We need to grab the .sdf file to put back into our solution as doing the first time sync with UploadOnly will not populate the DB on the mobile device (the one provided in the solution is missing a few columns (LastEditDate etc). OK, Run the demo in SyncDirection.Bidirectional (as in the original example) and do the first time sync. Cradle the emulated device and copy Program Files\GBADeviceClient\GBAppraiseDemo.sdf back into the solution's GBADeviceClient project.

    Now set the .sdf 's "Copy to Output Directory" to "Copy always".

    2) Change lines 24 & 26 in ClientSyncAgent.cs to be SyncDirection.UploadOnly

    3) Debug the project on the emulator - first time sync will not need to run anymore. "Mark Complete" the first record (Anita Lucerne). Sync and check on server that the record has changed. Now "Mark Incomplete" the same record (Anita Lucerne). Sync and check on server again (the record does not change)

    Thursday, October 29, 2009 8:45 PM