Select to view content in your preferred language

Unable to reconcile when conflicts between two versions

1847
9
Jump to solution
10-21-2025 10:46 PM
MatthiasBoucher
Occasional Contributor

Hello

I am working with ArcGIS Pro 3.3 and I am trying to build an addin in order to export in a file (txt/csv/xls) the conflicts that may occur during a reconcile bewteen two versions in my geodatabase. In ArcGIS Pro, the "Conflicts View" panel contains all the information that I want, but couldn't find a way to export it's content. That's why I am developping my own addin.

So, I used this piece of code in order to do the reconcile (and then later in case of conflicts export the listing). But I am facing the following error : Error code 160362  when reaching the "currentVersion.Reconcile" on line 20 :

if (geodatabase.IsVersioningSupported())
{
    using (VersionManager versionManager = geodatabase.GetVersionManager())
    using (ArcGIS.Core.Data.Version currentVersion = versionManager.GetCurrentVersion())
    using (ArcGIS.Core.Data.Version parentVersion = currentVersion.GetParent())
    {
        Debug.WriteLine($"Reconcile on {geodatabase.GetPath()}:\n{parentVersion.GetName()} => {currentVersion.GetName()}");

        Debug.WriteLine($"Current version : {currentVersion.GetName()}");
        Debug.WriteLine($"Parent version : {parentVersion.GetName()}");

        ReconcileOptions reconcileOptions = new ReconcileOptions(parentVersion);
        reconcileOptions.ConflictResolutionMethod = ConflictResolutionMethod.Abort;
        reconcileOptions.ConflictDetectionType = ConflictDetectionType.ByColumn;
        reconcileOptions.ConflictResolutionType = ConflictResolutionType.FavorEditVersion;
        reconcileOptions.ServiceSynchronizationType = ServiceSynchronizationType.Synchronous;

        Debug.WriteLine($"Conflits before reconcile: {currentVersion.HasConflicts()}");

        ReconcileResult reconcileResult = currentVersion.Reconcile(reconcileOptions);
        if (reconcileResult.HasConflicts)
        {
            Debug.WriteLine("Conflits after reconcile !");
        }
        else
        {
            Debug.WriteLine("No conflits !");
        }

        if (Project.Current.HasEdits) {
            await Project.Current.DiscardEditsAsync();
            Debug.WriteLine("Rollback done!");
        }
        else
        {
            Debug.WriteLine("No pending edits");
        }
    }
}

 

At first I thought my database was too old, as I'm still using traditionnal versioning, but I made another test on a database with branch versioning this time (with data accessed through a FeatureServer), and got the same error.

The code works fine when there are no conflicts bewteen my 2 versions. But when I create one conflict on purpose, I get the error. Do you have a clue what I might be doing wrong in my code ? 

Thanks,

Matthias

GIS developer
0 Kudos
1 Solution

Accepted Solutions
Aashis
by Esri Contributor
Esri Contributor

Hi @RadekMandovec, just a quick heads-up: the Pro SDK 3.7 will let you access conflict information from traditional versioning.

View solution in original post

9 Replies
RadekMandovec
Regular Contributor

Hi, I ran into the same problem and I think it’s a bug. I’ve already contacted ESRI support, because the error occurs when you use the setting ConflictResolutionMethod.Abort. If you use ConflictResolutionMethod.Continue, it works normally, but of course you lose the ability to resolve the conflict the way you want.

MatthiasBoucher
Occasional Contributor

Thank you for the feedback ! Do you know if an officiel ticket has been created by ESRI, and what is it's status ? Which version of the SDK were you using ? Was it on branch or traditional versioning ?

GIS developer
0 Kudos
RadekMandovec
Regular Contributor

I was informed that this is case Esri Case #04023992. I’m dealing with it through the local distributor (I’m from the Czech Republic), who forwarded it to ESRI. I was also given a direct link to the case page (https://my.esri.com/#/support/cases/tech-cases?caseNumber=04023992), but I can’t access it myself. I was using ArcGIS Pro version 3.5.1 and SDK version 3.4.0.55405 (which reminded me that I should update the SDK). I’m using traditional versioning.

Aashis
by Esri Contributor
Esri Contributor

Because of the ConflictResolutionMethod.Abort option, the reconcile operation is not permitted. Modify version edits to avoid conflicts, or set ConflictResolutionMethod.Continue to resolve conflicts using ConflictResolutionType.

The version.GetConflicts() is currently not supported for traditional versioning.

0 Kudos
Aashis
by Esri Contributor
Esri Contributor

Hi @RadekMandovec, just a quick heads-up: the Pro SDK 3.7 will let you access conflict information from traditional versioning.

RadekMandovec
Regular Contributor

Hi Aashis,

That's great! Thank you very much!

0 Kudos
RadekMandovec
Regular Contributor

Hi,

so I have now 3.7 version, but the problem is still there. When I set ConflictResolutionMethod.Abort I get following error:

ArcGIS.Core.Data.Exceptions.GeodatabaseVersionException: 'This operation is not allowed using conflicting versions.'

 ReconcileOptions reconcileOptions = new ReconcileOptions(targetVersion)
 {
     ConflictResolutionMethod = ConflictResolutionMethod.Abort,
     ConflictDetectionType = ConflictDetectionType.ByRow,
     ConflictResolutionType = ConflictResolutionType.FavorTargetVersion
 };

 ReconcileResult reconcileResult = childVersion.Reconcile(reconcileOptions);

  

0 Kudos
Aashis
by Esri Contributor
Esri Contributor

Set `ConflictResolutionMethod = ConflictResolutionMethod.Continue` in the `ReconcileOptions` class, then call `Reconcile` and fetch conflicts.

// Fetch conflicts
IReadOnlyList<Conflict> conflictsAfterReconcile = childVersion.GetConflicts();

// Iterate conflicts
foreach (Conflict conflict in conflictsAfterReconcile)
{
     // Object ID of the row where conflict occurred
     var objectId = conflict.ObjectID;

     var ancestorVersionValues = conflict.AncestorVersionValues;
     var childVersionValues = conflict.ChildVersionValues;
     var parentVersionValues = conflict.ParentVersionValues;
}

0 Kudos
RadekMandovec
Regular Contributor

If I set ConflictResolutionMethod = ConflictResolutionMethod.Continue in the ReconcileOptions, then call Reconcile, it resolves conflicts in favor of target version (because I set ConflictResolutionType = ConflictResolutionType.FavorTargetVersion) immediately, so when I try to fetch conflicts afterwards, it returns 0 conflicts.

I think there should be ConflictResolutionMethod.Abort to be able to work with conflicts, but unfortunately it does not work as I mentioned before. If I set ConflictResolutionMethod.Continue it resolves conflicts without opportunity to work with conflicts.

0 Kudos