PROBLEM
When editing, reconciling, or posting a version with ArcObjects, edits may be lost when stop editing or after the post operation.
Developers control the scope of all geodatabase edit operations with:
Code:
IWorkpaceEdit::StartEditOperation/StopEditOperation
Code:
IEditor.StartOperation/StopOperation
Code:
If pConflicts = True Then
pWorkspaceEdit.AbortEditOperation
Else
pWorkspaceEdit.StopEditOperation
pVersionEdit.Post
End If
Code:
Dim pVersionEdit As IVersionEdit
Dim pConflicts As Boolean
Set pVersionEdit = pCurrentVersion
pWorkspaceEdit.StartEditing True
pWorkspaceEdit.StartEditOperation
pConflicts = pVersionEdit.Reconcile("SDE.DEFAULT")
If pConflicts = True Then
pWorkspaceEdit.AbortEditOperation
Else
pVersionEdit.Post
End If
pWorkspaceEdit.StopEditing True
Note:
The above example does not include error handling. When performing a reconcile or post operation, check all error conditions. Check IVersionEdit::CanPost prior to attempting to calling IVersionEdit::Post.
Article ID:000007868
Get help from ArcGIS experts
Download the Esri Support App