none
Problems with ConstraintConflicts RRS feed

  • Question

  • Hello,

    I've ran into problem with ConstraintConflicts.

    ProcessChangeBatch (...)

    {

                IEnumerable<ItemChange> localChanges = _metadata.GetLocalVersions(sourceChanges);

                var changeApplier = new NotifyingChangeApplier(_idFormats);

                changeApplier.ApplyChanges(resolutionPolicy, CollisionConflictResolutionPolicy.ApplicationDefined,
                        sourceChanges, changeDataRetriever as IChangeDataRetriever,
                        localChanges, _metadata.GetKnowledge(), _metadata.GetForgottenKnowledge(),
                        this, _constraintConflictLog, _currentSessionContext,
                        syncCallbacks);

    ApplyChanges throws System.ArgumentException = {"Value does not fall within the expected range."}

    I'm reporting conflict like this

    SaveItemChange(...) {

    ....

                switch (saveChangeAction)
                {
                    case SaveChangeAction.Create:

    ....

    if (duplicate != null) {
                                var duplicateMeta = _metadata.FindItemMetadataByUniqueIndexedField("LocalId", duplicate.LocalId);
                                context.RecordConstraintConflictForItem(duplicateMeta.GlobalId, ConstraintConflictReason.Collision);

    DestinationCallbacks.ItemConstraint never gets called

    Tuesday, June 12, 2012 9:07 AM

All replies

  • Stacktrace:

       at Microsoft.Synchronization.CoreInterop.ISynchronousNotifyingChangeApplier2.ApplyChanges(CONFLICT_RESOLUTION_POLICY resolutionPolicy, COLLISION_CONFLICT_RESOLUTION_POLICY collisionPolicy, ISyncChangeBatch pSourceChanges, Object pUnkDataRetriever, IEnumSyncChanges pDestinationVersions, ISyncKnowledge pDestinationKnowledge, IForgottenKnowledge pDestinationForgottenKnowledge, ISynchronousNotifyingChangeApplierTarget pChangeApplierTarget, IConflictLogAccess pConflictLogAccess, ISyncSessionState pSessionState, ISyncCallback pCallback)
       at Microsoft.Synchronization.NotifyingChangeApplier.ISynchronousNotifyingChangeApplierImpl.ApplyChanges(CONFLICT_RESOLUTION_POLICY resolutionPolicy, COLLISION_CONFLICT_RESOLUTION_POLICY collisionPolicy, ISyncChangeBatch pSourceChanges, Object pUnkDataRetriever, IEnumSyncChanges pDestinationVersions, ISyncKnowledge pDestinationKnowledge, IForgottenKnowledge pDestinationForgottenKnowledge, ISynchronousNotifyingChangeApplierTarget pChangeApplierTarget, IConflictLogAccess pConflictLogAccess, ISyncSessionState pSessionState, ISyncCallback pCallback)
       at Microsoft.Synchronization.NotifyingChangeApplier.ApplyChanges(ConflictResolutionPolicy resolutionPolicy, CollisionConflictResolutionPolicy collisionConflictResolutionPolicy, ChangeBatch sourceChanges, IChangeDataRetriever changeDataRetriever, IEnumerable`1 destinationVersions, SyncKnowledge destinationKnowledge, ForgottenKnowledge destinationForgottenKnowledge, INotifyingChangeApplierTarget changeApplierTarget, IConflictLogAccess conflictLogAccess, SyncSessionContext syncSessionState, SyncCallbacks syncCallback)
       at Synchronizer.Providers.SyncProvider.ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics) in D:\work\sync\Synchronizer.Providers\SyncProvider.cs:line 479
       at Microsoft.Synchronization.KnowledgeProviderProxy.ProcessChangeBatch(CONFLICT_RESOLUTION_POLICY resolutionPolicy, ISyncChangeBatch pSourceChangeManager, Object pUnkDataRetriever, ISyncCallback pCallback, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)
       at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
       at Microsoft.Synchronization.SyncOrchestrator.Synchronize()

    Tuesday, June 12, 2012 9:17 AM
  • Trace Log

    [0]163C.1A90::06/12/2012-14:26:14.754 [engine]Notifying change applier: Entering CSyncChangeWrapper::GetCreationVersion
    [0]163C.1A90::06/12/2012-14:26:14.754 [engine]Notifying change applier: Leaving  CSyncChangeWrapper::GetCreationVersion Returning hr = 0x80070057
    [0]163C.1A90::06/12/2012-14:26:14.754 [engine]Notifying change applier: Entering CSyncChangeWrapper::~CSyncChangeWrapper
    [0]163C.1A90::06/12/2012-14:26:14.754 [engine]Notifying change applier: Leaving  CSyncChangeWrapper::~CSyncChangeWrapper
    [0]163C.1A90::06/12/2012-14:26:14.754 [engine]Notifying change applier: Leaving  CChangeApplier::HandleConstraintConflict Returning hr = 0x80070057

    Tuesday, June 12, 2012 11:35 AM