locked
How does sync handle data collision? Device database changes not reflected on server, though trace says change applied. RRS feed

  • Question

  • Hi,

    I have a scenario where I'm syncing an .SDF on a device (SD card with WindowsCE) with SQL 2008 Express on a desktop using WCF in a Windows service. I made a change on the device which triggers an UploadOnly sync, and at about the same time made a change to the corresponding server row using a desktop app, which also triggers a UDP broadcast requesting a DownloadOnly sync.
    The result was that the UploadOnly occured 1st, with the following trace from trace Listener and service log;

    VERBOSE, SyncHostService, 5, 11/18/2009 21:06:19:513,    Update could not be applied
    INFO   , SyncHostService, 5, 11/18/2009 21:06:19:513,
    INFO   , SyncHostService, 5, 11/18/2009 21:06:19:529,       Updates Applied: 1

    <SyncTableProgress>
     <TableName>Vehicle</TableName>
     <Inserts>0</Inserts>
     <Updates>1</Updates> 
     <Deletes>0</Deletes>
     <ChangesApplied>1</ChangesApplied>
     <ChangesFailed>0</ChangesFailed>
     <Conflicts></Conflicts>
    </SyncTableProgress>

    Update couldn't be applied, but was???

    followed by the DownloadOnly with the trace

    INFO   , SyncHostService, 5, 11/18/2009 21:06:26:623,       Changes Enumerated: 1

    The result is that the .SDF has a duplicate of the server record, but the .SDF changes are not reflected on the server.

    Could it be that it was trying to sync the device data at the same time the server was being updated for the local change and failed because the record was locked? If that's the case, why does it say the update was applied? If not the case, why weren't the changes applied?

    NOTE: Both UploadOnly and DownloadOnly work fine if I don't try making changes simultaneously.

    Using Sync Framework v2 on server, v1 ADO v2 for device app.

    Thanks for any thoughts on this,

    Brian
    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:28 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, November 19, 2009 3:20 PM

Answers

  • Probably what is happening after the upload is completed successfully, you make local change on the server overwriting the uploaded value.  When the downloadOnly kick off, it will apply  new server values on the client side.  This is expected?

    Also the behaviour will depend on the conflict resolution policy set by you.

    thanks
    Jandeep


    jandeepc
    Thursday, November 19, 2009 11:52 PM

All replies

  • Probably what is happening after the upload is completed successfully, you make local change on the server overwriting the uploaded value.  When the downloadOnly kick off, it will apply  new server values on the client side.  This is expected?

    Also the behaviour will depend on the conflict resolution policy set by you.

    thanks
    Jandeep


    jandeepc
    Thursday, November 19, 2009 11:52 PM
  • Thanks for the response Jandeep. I've been out of town several days, so apologize for not replying sooner.

    I'm trying to get a sql profiler running for sql express to verify the sequence of events.

    Thanks,
    Brian
    Tuesday, December 1, 2009 11:03 PM