locked
Handle conflicts on client ....its urgent . RRS feed

  • Question

  •  

    I am implementing sync services across WCF, which so far seems to be working well. However, I need to be able to allow the client to resolve conflicts. From what I can see, you would want to subscribe to the ApplyChangeFailed event. That would be fine, but it only exists under the ServerSyncProvider which, unless I am missing something, cannot be accessed client side. I know you can subscribe to this event on the server, from within the WCF application in my case. But handling this server side only limits you as the user would not be able to decide how the conflict should be handled.

     

    My question is what is the recommended way of handling conflicts client side in an n-tier environment and is it possible to handle the ApplyChangeFailed event client side?

     

    Wednesday, October 8, 2008 1:02 PM

Answers

  • Definitely!

     

    Did you try to look at your client sync provider class.

    Something like LocalDataCache1ClientSyncProvider. This class implements SqlCeClientSyncProvider.

     

    This class is designer generated so you could create another partial code and wireup events.
    It exposes these events. Just type "this." and you could easily see those events.

    Wednesday, October 8, 2008 6:17 PM

All replies

  • Definitely!

     

    Did you try to look at your client sync provider class.

    Something like LocalDataCache1ClientSyncProvider. This class implements SqlCeClientSyncProvider.

     

    This class is designer generated so you could create another partial code and wireup events.
    It exposes these events. Just type "this." and you could easily see those events.

    Wednesday, October 8, 2008 6:17 PM
  • I  do  have client sync provider,but the problem is applychangefailed event occurs only in insert_ inser conflict on client provider , what abt other conflicts ?

    Friday, October 10, 2008 4:34 AM
  • That is an expected behavior by design.

     

    I am confident taht you are using bi-directional sync at client side.

    In bi-directional sync, changes are first uploaded to server (which actually changes the data at server side and error is raised at client side only) and then after upload, they are downloaded so you don't see any conflict (coz it has already been resolved).

     

    If you want to handle conflict at client side:

    1.  do an download sync first (syncagent.tablename.syncdirection=DownloadOnly)

    2. then you will see conflict,

    3. handle conflict at client side

    4. Do an upload sync (syncagent.tablename.syncdirection=UploadOnly)

     

    Hope this answers your question.

     

    Rahul Gangwar

    MSFT

     

     

    Friday, October 10, 2008 4:54 PM