locked
Cannot force transaction on syncgroup RRS feed

  • Question

  • Hi,

    According to MSDN:

     

    "A synchronization group is a mechanism to ensure consistent application of changes for a set of tables. If tables are included in a synchronization group, changes to those tables are transferred as a unit and applied in a single transaction. If any change in the group fails, changes for the whole group are retried on the next synchronization."

     

    I put all my tables into one group. I'm doing an update of my local data and add a few new rows, too. Then I call the Synchronize method. The first update causes ApplyChangesFailed event to be raised. The other inserts pass successfully. I end up with inconsistent DB . Where's the transaction then ? What am I missing ?

     

    Regards

    • Edited by default_user44 Thursday, April 15, 2010 9:41 PM misspelling
    Thursday, April 15, 2010 9:41 PM

Answers

  • try throwing an exception in the ApplyChangesFailed.

    • Marked as answer by JuneT Thursday, July 8, 2010 1:40 PM
    Friday, April 16, 2010 4:00 PM

All replies

  • the ApplyChangesFailed is raised when a conflict occurs for each row being applied, you then have a chance to specify how do you want to resolve the conflict either by specifying any of the built conflict actions or calling your own conflict resolution.

    If you don't do anything with the conflict then it simply proceeds to the next row.

    If you don't want to apply any of the changes because of a conflict, you can simply abort the sync in the ApplyChangesFailed event itself.

    Thursday, April 15, 2010 11:10 PM
  • If you don't want to apply any of the changes because of a conflict, you can simply abort the sync in the ApplyChangesFailed event itself.

    How can I do that ? Already tried e.Transaction.Rollback() with no luck.

    You're talking about aborting whole sync process at once ?

    I wish I could abort a transaction withing the particular SyncGroup as they're supposed to behave in this way, aren't they ?

     

    Friday, April 16, 2010 7:28 AM
  • try throwing an exception in the ApplyChangesFailed.

    • Marked as answer by JuneT Thursday, July 8, 2010 1:40 PM
    Friday, April 16, 2010 4:00 PM