This document is archived and information here might be outdated.  Recommended version.

Reconciling versions (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Managing data > Working with feature data > Versioning > Reconciling versions

Reconciling versions

At any time, the changes in source version can be reconciled with any ancestor version, such as the parent or default version. To reconcile changes, the source version must be explicitly reconciled with a target version. This topic discusses the available options when reconciling.

In this topic

About reconciling versions

The IVersionEdit4 interface contains the Reconcile4 method with the following five arguments:
  • VersionName
  • acquireLock
  • abortIfConflicts
  • ChildWins
  • columnLevel
Each argument affects how the reconcile is performed. It is important to understand the impact of the different property values and influence they have on the reconcile process.


The VersionName property is the name of the target version that the source version is reconciled against. The target version must be an ancestral version, for example, the immediate parent version or default version.


The default behavior of reconcile is to obtain a shared version lock on the target version. The lock ensures the target version cannot be reconciled while the source version can be reconciled. The purpose of the version lock on the target version is to ensure the version is available when the intention is to post. If the intention is not to post to the target version following a reconcile, the acquireLock parameter can be set to false.


It is also possible to abort the reconcile when a conflict is detected. Setting the abortIfConflicts to true aborts the reconcile process when conflicts are detected; for example, this can be used when performing the reconcile in a batch process without human interaction to resolve the conflicts.


If conflicts occur, the conflicts are initially resolved in favor of the target version. Setting this argument to true replaces all conflicting features with the source version's representation of the object.


The reconcile method also provides the ability to define what constitutes a conflict during the reconcile. The columnLevel argument is a Boolean argument that if set to true, only promotes the same modified object in both versions as a conflict if the same attribute for the object has changed in both versions. For example, if a feature was moved in the target version, the same feature's attribute was updated in the edit version, and if column level conflict filtering was set to true, the reconcile would not detect this feature as a conflict.
The following code example shows how reconcile can be used in a versioned edit session:
public void ReconcileandPost(IVersion editVersion, IVersion targetVersion)
    IMultiuserWorkspaceEdit muWorkspaceEdit=(IMultiuserWorkspaceEdit)editVersion;
    IWorkspaceEdit workspaceEdit=(IWorkspaceEdit2)editVersion;
    IVersionEdit4 versionEdit=(IVersionEdit4)workspaceEdit;

    if (muWorkspaceEdit.SupportsMultiuserEditSessionMode
        //Reconcile with the target version.
        bool conflicts=versionEdit.Reconcile4(targetVersion.VersionName, true,
            false, false, false);
        if (conflicts)
            MessageBox.Show(" Conflicts Detected ");
            MessageBox.Show(" No Conflicts Detected ");
        //Post to the target version.
        if (versionEdit.CanPost())
Public Sub ReconcileAndPost(ByVal editVersion As IVersion, ByVal targetVersion As IVersion)
    Dim muWorkspaceEdit As IMultiuserWorkspaceEdit=CType(editVersion, IMultiuserWorkspaceEdit)
    Dim workspaceEdit As IWorkspaceEdit=CType(editVersion, IWorkspaceEdit2)
    Dim versionEdit As IVersionEdit4=CType(workspaceEdit, IVersionEdit4)
    If muWorkspaceEdit.SupportsMultiuserEditSessionMode(esriMultiuserEditSessionMode.esriMESMVersioned) Then
        Dim conflicts As Boolean=versionEdit.Reconcile4(targetVersion.VersionName, True, False, False, False)
        If conflicts Then
            MessageBox.Show(" Conflicts Detected ")
            MessageBox.Show(" No Conflicts Detected ")
        End If
        If versionEdit.CanPost Then
        End If
    End If
End Sub

Using RecommendedReconcileOrder on IVersionedWorkspace2

The RecommendedReconcileOrder property returns an enumerator of version names based on the ascending order of each version's common ancestor state with respect to the default version. If a version's common ancestor state is equal to or greater than the state the default version references, it will not be included in the enumerator.
The property is intended to be used before running a compress. If all or some of the versions returned by RecommendedReconcileOrder are reconciled based on the enumerator's order, the compress operation can move more rows from a table's versioned delta tables to the base tables. The more versions reconciled based on the order of versions returned, the more rows will be compressed to the base table.

To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):

Development licensing Deployment licensing
ArcGIS Desktop Standard ArcGIS Desktop Standard
ArcGIS Desktop Advanced ArcGIS Desktop Advanced
Engine Developer Kit Engine: Geodatabase Update