ArcObjects Library Reference (GeoDatabase)  

IWorkspaceEdit.StopEditing Method

Stops editing the workspace.

[Visual Basic .NET]
Public Sub StopEditing ( _
    ByVal saveEdits As Boolean _
)
[C#]
public void StopEditing (
    bool saveEdits
);
[C++]
HRESULT StopEditing(
  VARIANT_BOOL saveEdits
);
[C++]

Parameters

saveEdits [in]   saveEdits is a parameter of type VARIANT_BOOL

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Errors Returned

FDO_E_VERSION_REDEFINED: The version has been redefined to reference a new database state.

Remarks

The StopEditing method is used to end an edit session. The saveEdits parameter controls if edits are saved or discarded. An ArcSDE geodatabase can support multiple concurrent edit sessions on the same version of the database. In such a scenario, StopEditing will return an error code of FDO_E_VERSION_REDEFINED if it detects that the database state associated with the version being edited is no longer the same as it was at the beginning of the edit session (indicating that the version was modified by some other edit session). In this case the application is responsible for calling the IVersionEdit::Reconcile method to reconcile the edit session against the current state of the version being edited. StopEditing may be called again after reconciliation.

Note:  With non-versioned editing always be sure to check the current edit state via IsBeingEdited before called StartEditing or StopEditing.  If the workspace is being edited outside your context, there will be issues if you call StopEditing.  This will cause any other editors of the workspace to become decoupled with the potential loss of their edits.

This method explicitly commit of any active transactions in the database.

See Also

IWorkspaceEdit Interface