Select to view content in your preferred language

Unable to reconcile when conflicts between two versions

204
3
2 weeks ago
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
3 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.