Inserting and updating rows inside an edit session

As I've mentioned throughout the chapter, inserts, updates, or deletes to a table or feature class done outside an edit session are permanent. They can't be undone. Edit sessions give you much more flexibility for rolling back any unwanted changes.

Getting ready

Up until now, we've used insert and update cursors to add, edit, and delete data from feature classes and tables. These changes have been permanent as soon as the script was executed and can't be undone. The new Editor class in the Data Access module supports the ability to create edit sessions and operations. With edit sessions, changes applied to feature classes or tables are temporary until permanently applied with a specific method ...

Get Programming ArcGIS 10.1 with Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.