Hi,
I'm trying to use the 'Calculate Geometry' tool (selected by right-clicking a field in the attribute table) to calculate XY coordinates for a point and have also tried to calculate square miles for a polygon feature. I am getting a "RuntimeError: Objects in this class cannot be updated outside an edit session". It was my understanding that edit sessions are automatic in ArcPro. How would I go about starting an edit session?
Thanks for your help,
Aileen
Hey Drew - I get the same error - versioned feature classes - SQL 2012
Hello Drew,
Same error here on ArcGIS Pro 2.2 with Oracle 12.10.2
1. Created polygon feature class and draw some polygons
2. Added a field (double) and right-clicked for Calculate Geometry -> Worked
3. Register as versioned
4. Added a new field (double) and did another Calculate Geometry -> Error "RuntimeError: Objects in this class cannot be updated outside an edit session"
5. Tried the previous field: same error.
6. Reopened ArcGIS Pro, Calculate Geometry -> Same error
7. Unregister as versioned
8. Calculate Geometry: Worked
Just to clarify on the original question, starting an edit session manually wouldn't make the tool start to work. The tool uses arcpy.da cursors to calculate the geometry properties into the field, and these cursors need to work within an arcpy.da.Editor block in some cases. This logic is already in the tool, so I'm not sure what's going wrong with the logic, but would appreciate if you can contact tech support as soon as possible so we can start fixing the bug.
Thanks
SDE 10.6 SQL 2014 ENT, FC Storage type is Geography. I'll try to get a video going....
BUG-000115460 Calculate Geometry fails with certain types of enterprise geodatabases, SDE, and database versions (plus versioned classes) is fixed in 2.2.1 Release notes for ArcGIS Pro 2.2—ArcGIS Pro | ArcGIS Desktop I know Drew Flater put a lot of elbow grease into getting this fixed!
Can someone from ESRI be more specific with the below statement from the Release Notes alluded to above:
Calculate Geometry fails with certain types of enterprise geodatabases, SDE, and database versions (plus versioned classes).
What versions of Oracle does this bug apply to?
Does this bug include file gdbs?
The bug was not reported and was never experienced with file geodatabase.
I believe any Oracle enterprise geodatabase version would be impacted, thought all the known cases have been addressed in 2.2.1.
You need to change something. Edit something. Once you click "Save", the edit session is considered ended. Just alter something in your feature, don't click save, then go through the calculate geometry process. It will work.
Thomas:
What version of Pro are you testing on? What type of enterprise GDB are you using (e.g. SQL Server, Oracle, other)?
ArcGIS Pro 2.2.4
SQL Server 2014