I would like to know if it is possible to undo and redo changes outside of an edit session?

If yes, how can I do it in ArcObjects using .NET?

I am working on an ArcSDE 10.1 versioned geodatabase?

  • Are you looking to undo/redo the entire edit session or a specific edit operation? The closest I've gotten to this is when undoing an edit session and using GDBT for ArcCatalog and find the STATE_ID from the start of the edit session and the change the state_id of the version in the versions table SDE.VERSIONS to that value. And hope a compress hasn't occured. Apr 11, 2013 at 20:23
  • yes i want to undo an entire edit session, but undoing using ArcObjects .NET or Pgsql queries to get and set state_id ? can you explain more your suggestion ?
    – geogeek
    Apr 11, 2013 at 21:24

1 Answer 1


Undoing edits in ArcObjects without an edit session is not possible. Redo is only available in a versioned edit session. Nonversioned edit session only have save (commit) or don't save (rollback).

Any edits made outside an edit session are immediately commited to the database. Furthermore, for nonversioned edits, certain geodatabase functionality prevents editing without an edit session. For versioned feature class, I don't think ArcObjects will allow you to make any edit without an edit session.

You COULD run your own sql through IWorksapce.ExecuteSQL. You COULD run update statments and whatever else you would like. The downside of this is that ArcObjects may commit your changes with any DDL, metadata update or random commit that it may perform.

If you want to undo an entire versioned edit session, you will need to know what the state_id of the session was before you made your first edit. If you wanted to do this from pure ArcObjects, you could create a new version before starting your edit session. Do your edit, and save your session. At that point you would have one version pointing to the original state, and another pointing the to the new state. If you wanted to "undo" the edit, connect to the old version, and delete the new version.

Is there a reason you don't want to use an edit session?

  • i'm working on SDE versioned Database, i use edit session only to update data then i close the edit session, so i cannot work with undo and redo offered by the session. i thought to use undo and redo outside edit session. thanks you have given me a clearer idea about the problem.
    – geogeek
    Apr 13, 2013 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.