locked
Sever changes failed but No Exception in client side RRS feed

  • Question

  • I just don't understand how the sync framework handles the error.

    In my problem, sync failed on the server due to missing parameter but at the client side no exception was thrown and
    nothing gets updated although the anchor got updated and in the next sync the sync framework assumes that the data from server and client are same
    actually they are not anymore.

    I know something that i need to handle the event at ApplyChangesFailed event. Is it correct?
    I wanna abort the synchronization if there are some error at the server.

    Where shall i put those code and how can it be done?

    Thank you very much in advance.

    Regards
    Bo Bo
    • Moved by Max Wang_1983 Thursday, April 21, 2011 11:16 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, September 24, 2009 10:15 AM

Answers

  • Sorry Bo for not replying this in time.

    all failures when applying changes when caue the applyChangeFailed event to fire and this is where the applications can resolve the conflict ( or failures ) based on the users' desired outcome to fir the business logic.

    as you may already found out, you can choose any one of the forementioned actions to achieve your desired behavior, to be specific, in your caes, if you choose retrywithforcewrite, the delete will be forcely applied to delete the row depite it was updated on the server.

    hope this helps.

    thanks
    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, September 28, 2009 4:42 AM
    Moderator

All replies

  • Another question pls :

    Server changes Client deleted and Sync failed. Where should i handle that event?


    Regards
    Bo Bo
    Friday, September 25, 2009 6:28 AM
  • The follwing is the method i have handled at the server side....

    private void ApplyChangeFailed(object sender,ApplyChangeFailedEventArgs args)
        {
            if (args.Conflict.ConflictType == ConflictType.ClientDeleteServerUpdate)
            {
                args.Action = ApplyAction.RetryWithForceWrite;
            }
            else if(args.Conflict.ConflictType == ConflictType.ClientUpdateServerDelete)
            {
                //  there will be no such action
            }
            else if (args.Conflict.ConflictType == ConflictType.ClientUpdateServerUpdate)
            {

            }

        }


    What is going to happen if Client Delete and Server Update and apply action is "RetryWithForceWrite"?

    There are three actions to invoke 
    ApplyAction.Continue
    ApplyAction.RetryApplyingRow
    ApplyAction.RetryWithForceWrite


    for conflicts :
    ConflictType.ClientDeleteServerUpdate
    ConflictType.ClientUpdateServerDelete
    ConflictType.ClientUpdateServerUpdate
    ConflictType.ClientInsertServerInsert

    Can someone explain to me the effect of those actions for the conflicts or guide me where i could read those information?


    Regards
    Bo Bo
    Friday, September 25, 2009 7:25 AM
  • Hi all ..

    immmmm I have to assume that.....
    This thread is as not active as other partners' threads.

    Regards
    Bo Bo
    Monday, September 28, 2009 2:16 AM
  • Sorry Bo for not replying this in time.

    all failures when applying changes when caue the applyChangeFailed event to fire and this is where the applications can resolve the conflict ( or failures ) based on the users' desired outcome to fir the business logic.

    as you may already found out, you can choose any one of the forementioned actions to achieve your desired behavior, to be specific, in your caes, if you choose retrywithforcewrite, the delete will be forcely applied to delete the row depite it was updated on the server.

    hope this helps.

    thanks
    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, September 28, 2009 4:42 AM
    Moderator