Handling Conflicts RRS feed

  • Question

  • I have a collaborative scenario to synchronize two database. I have wcf service at the remote site and at the local side i m tryin to get conflicts. Also, direction of synchronization is always download. Following code is written to create local provider;

    KnowledgeSyncProvider destinationProvider = null;
    destinationProvider = newSqlSyncProvider(args.RepConfig.ScopeID, sConnection);((SqlSyncProvider)destinationProvider).ChangesApplied += (s, DbChangesAppliedEventArgs) => replicationAgent_ChangesApplied(args, DbChangesAppliedEventArgs);
    destinationProvider.Configuration.ConflictResolutionPolicy = ConflictResolutionPolicy.ApplicationDefined;
    destinationProvider.DestinationCallbacks.ItemConstraint += newEventHandler<ItemConstraintEventArgs>(DestinationCallbacks_ItemConstraint);
    destinationProvider.DestinationCallbacks.ItemChanging += newEventHandler<ItemChangingEventArgs>(DestinationCallbacks_ItemChanging);
    destinationProvider.DestinationCallbacks.ItemConflicting += newEventHandler<ItemConflictingEventArgs>(DestinationCallbacks_ItemConflicting);
    destinationProvider.DestinationCallbacks.ItemChangeSkipped += newEventHandler<ItemChangeSkippedEventArgs>(DestinationCallbacks_ItemChangeSkipped);

    why these events does not work ? after synchronization statistics says that there is one download and when i check database there is no change and in this scenario there should be conflict event that is raised... Can anybody explain to me why these events cant work ?

    Tuesday, February 28, 2012 1:10 PM


All replies

    • Marked as answer by sk0601 Thursday, March 1, 2012 11:07 PM
    Tuesday, February 28, 2012 9:49 PM
  • yes, this sample solved my problem but, why item_conflict event was not raised for only download direction ?
    Thursday, March 1, 2012 9:20 AM
  • while the SqlSyncProvider is based on the KnowledgeSyncProvider, it actually raises different events. when you look at the definition of those events you specified above, you will find that they practically dont apply to database synchronization. you'll find them more applicable to the filesyncprovider for example.
    • Marked as answer by sk0601 Thursday, March 1, 2012 11:07 PM
    Thursday, March 1, 2012 5:33 PM
  • thanks a lot
    Thursday, March 1, 2012 11:07 PM