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
That did the trick for me.Sql 2017, versioned SDE database, editing the default version, Pro 2.4.1
ArcGIS Pro 2.2.4
SQL Server 2014
Thomas:
What version of Pro are you testing on? What type of enterprise GDB are you using (e.g. SQL Server, Oracle, other)?
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.
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.
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?
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!
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
Hey Drew - I get the same error - versioned feature classes - SQL 2012
SDE 10.6 SQL 2014 ENT, FC Storage type is Geography. I'll try to get a video going....
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
Probably not what you want to hear...but, we are using SQL Server (2016 version, I think).
Aileen Profir Thomas Colson what type of enterprise gdb are you using? We've tested in house on SQL Server and Postres, using unversioned feature classes, and it's working here. Thanks
EDIT: Tested Oracle too, and found it working. Any details about the repro steps can get us started on fixing this for the first 2.2 patch. Thanks
I'll see if any one else on GN can confirm the behavior, then log a case next week, unless you want to, but do keep the thread posted so TS isn't getting the same call twice.
Well, I'm glad it's not just my imagination 😃
Thanks!
Well, belay that. I get the same error on versioned and un-versioned SDE feature classes, and just on calculate geometry. I can make all other field calculations. Another thing I missed during Beta....
Seems like a bug...
Editing directly to the default SDE...
Is the SDE feature class versioned, are you direct editing against the SDE? If it is versioned, what version are you editing?
Yeah, it was just the standard upgrade to 2.2. I do have the checkbox for newly added layers editable by default checked off. It is in SDE, which I thought might be the issue at first, but I can still make all kinds of other edits without an issue (update attributes, move, merge etc.). This is the error message...
I'm not seeing that...how did you get to 2.2? Upgrade, or clean install? (Guess what tech support is going to ask you to do....). What is the source of the data, FGDB, SDE, Shapefile, Feature Service, Offline Feature Service in SQLite Mobile Geodatabase? What options do you have set here:
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.