none
How to handle the sql errors when applying changes in sync fx RRS feed

  • Question

  • Hi, everyone!

    I am developing the custom syn app using sync fx for sql express client and sql server.

    My problem is:

    I removed one row on client db, then synced.

    But I got one failed applied(not uploaded changes). The reason is because that row can't be removed on server because of FK constraints.

    In this case, I want to rollback the client change.

    How can I do this?  I can only catch the event on server side.

    Destination(server) provider can catch the conflict(conflict type is Error occurred.)

    will appreciate your any help.

    Looking forward to your reply.

    Thanks for your attention.

    Best Regards

     

    Friday, January 28, 2011 6:04 PM

Answers

  • you can hook up with the ApplyChangeFailed event and then throw application level exception to cancel the sync, in turn, the transaction to apply the changes to the server will be rolled back. thanks Yunwen
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, January 31, 2011 2:56 AM
    Moderator

All replies

  • you can hook up with the ApplyChangeFailed event and then throw application level exception to cancel the sync, in turn, the transaction to apply the changes to the server will be rolled back. thanks Yunwen
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, January 31, 2011 2:56 AM
    Moderator
  • Hi, Yunwen

    Thanks for your reply.

    But I can only hook up the ApplychangeFailed in server provider. Server database isn't applied now.

    I want to rollback the client change. This means that I want to catch the failed event on client so that I can rollback the client change.

    Please review my first posting  carefully.

    Best Regards

    Monday, January 31, 2011 12:02 PM
  • Sorry I didnt get it last time. for the client side, once the transaction is committed to the db, you cannot retro-fix them. you can consider backup the database before sync. then if the sync failed and server side application was rolled back. you can restore from the back up.

    thanks

    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, January 31, 2011 3:59 PM
    Moderator