locked
Resolving Conflicts in Sql Server to Sql Server N-Tire synchronization RRS feed

  • Question

  • Hi,

    I am working on N-Tire Sql Server Synchronization. I am facing a problem of conflicts.

    Example a record with same primary key is added in both server and client databases, data is updating instead of adding a new record to server from client.

    Also i would like to know if we resolve the above situation, how should we update all child records with updated parent record id.

    I will be thank full to all who are trying to help me.

     

    Regards,

    Venkata Raman.

    Friday, January 28, 2011 9:13 AM

All replies

  • Hi, Venkata

     

    Would you like to explain more detail? (What are going to do?)

    Regards

    Tuesday, February 1, 2011 2:55 PM
  • Hi,

    An N-Tier sync is just like a normal sync, except that a proxy is used for the remote provider over WCF.  Sync Framework will automatically resolve conflicts for an N-Tier sync according to the conflict resolution policy you've specified for the providers, just like it does for a normal sync.

    If I understand your question correctly, when there's a record with the same primary key on both the client and server databases, the behavior you see is that either the server record gets updated or the client record gets updated (depending on the conflict resolution policy you've set).  However, what you expect to see is that when there is a conflicting record, you want to keep both records, and modify the primary key of one of the records to remove the conflict.  Sync Framework does not support that behavior out of the box.  The default sync behavior in a conflict situation is for one side (either client or server) to "win" that conflict, and update the other side.

    You could try to partition your primary key ranges if you need to keep both records.  For example, use odd integers for primary key on server, and even integers for primary key on clients.  This way you will not run into conflicting scenarios.

    Please let me know if you have other questions or concerns.

    Thanks,

    Minh.

    Friday, February 4, 2011 12:43 AM