Online insertion for primary keys with auto-increment values RRS feed

  • Question

  • I have a SQL CE table that has integer as primary key with auto-increment set on server. The table has bi-directional synchronization enabled. However for doing inserts I am using custom logic to do online inserts on server before using synchronization service. Here is the step by step process:

    1) User edits a row of table on mobile application. Lets say the primary key of deleted row is 1234

    2) Application deletes the row (1234) and creates a new one with edited parameter. So at this point the a new row is created with a primary key of say 1 on mobile client and row with PK of 1234 is deleted.

    3) Right before synchronization, application uses clientsyncprovider.getchanges to get all inserts and then uses a custom web service to do the inserts on server.

    4) syncAgent.Synchronize() method is called after this so that the updates and deletes on client (of row in step 1) are applied. 

    However I am getting ClientDeleteServerUpdate conflict on step 4 for row with 1234 PK and no deletes are applied to the server.

    Any help on this is highly appreicated. I have been struggling with this for days now.

    I even tried doing the deletes also using custom web service. But could not find a way to read the primary key values of deleted rows from _sysocsRowsDeleted table..seems the values are in byte[].

    • Moved by Hengzhe Li Friday, April 22, 2011 7:32 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, December 19, 2008 6:50 PM