InsertCursor not working on featureclass with Attachments

3329
2
10-23-2011 11:57 PM
MortenHjelmsmark
New Contributor II
My InsertCursor works fine on the featureclass until I 'Create Attachments' to the feature class through ArcCatalog, then I get 'Objects in this class cannot be updated outside an edit session'.

This is clearly a problem since 'All updates or insertions to a table are done outside an edit session in ArcGIS' when using arcpy.InsertCursor.

I'm not trying to insert attachments, just features into the featureclass.

Is there a workaround?
Tags (2)
0 Kudos
2 Replies
ChristinaGnadinger
New Contributor II
I am trying to edit data that have feature linked annotation ... and am getting the same error. I have been digging and digging and have yet to find a way to start an edit session through the script. I've even loaded the script into ArcToolbox, started editing, ran the script, and still had it fail on me.

If anyone has any advice I would appreciate it as well!!



My InsertCursor works fine on the featureclass until I 'Create Attachments' to the feature class through ArcCatalog, then I get 'Objects in this class cannot be updated outside an edit session'.

This is clearly a problem since 'All updates or insertions to a table are done outside an edit session in ArcGIS' when using arcpy.InsertCursor.

I'm not trying to insert attachments, just features into the featureclass.

Is there a workaround?
0 Kudos
BrandonKeinath1
Occasional Contributor III

This seems to be a very old thread but ran into this problem today.  I was able to get around it by using an arcpy.da.InsertCursor rather than the non-da style.  When you were having this issue were you using a non-da InsertCursor? 

Thanks,


Brandon

0 Kudos