locked
Conflict Resolution with N Tier RRS feed

  • Question

  • Hello,

    I am trying to implement the conflict resolution (as shown in Demo IV) on server side in N Tirer architecture using web service. I just want the server action to take predence over any client updates. Therefore on client side, I just follow the default action of Continuing.

    However on the server side I added this code to my web service. Is this the right way to handle conflicts in this scenario?

    What if I dont add this code on the server side? Does the default action of 'Continue processing, and add the row to the list of conflicts that are defined in SyncConflict' will be applied to the server side conflicts in that case?

    I am assuming that I will have to modify the stored procedures for applying insert, updates and deletes to take care of this RetryWithForce scenario?

    Appreciate any help on this.

    Thanks

    Apurv

     _serverProvider.ApplyChangeFailed += new EventHandler<ApplyChangeFailedEventArgs>(ManageServerConflicts);

     private void ManageServerConflicts(object syncAgent, ApplyChangeFailedEventArgs args)
        {

            if (args.Conflict.ConflictType == ConflictType.ClientInsertServerInsert)
            {

                // ClientInsertServerInsert
                args.Action = ApplyAction.RetryWithForceWrite;

            }

            if (args.Conflict.ConflictType == ConflictType.ClientUpdateServerUpdate)
            {

                // ClientUpdateServerUpdate
                args.Action = ApplyAction.RetryWithForceWrite;

            }

            if (args.Conflict.ConflictType == ConflictType.ClientDeleteServerUpdate)
            {

                // ClientDeleteServerUpdate
                args.Action = ApplyAction.RetryWithForceWrite;

            }

            if (args.Conflict.ConflictType == ConflictType.ClientUpdateServerDelete)
            {

                // ClientUpdateServerDelete
                args.Action = ApplyAction.RetryWithForceWrite;

            }

        }
    • Moved by Max Wang_1983 Friday, April 22, 2011 8:10 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, April 7, 2008 5:29 PM