Select to view content in your preferred language

Why can't I save/delete annotations using CoreHost?

1941
6
09-12-2020 03:45 PM
SungBae
Emerging Contributor

Environment/Project

  • ArcGIS Pro 2.6
  • .NET Framework 4.8 CoreHost referencing ArcGIS.Core 12.6.0

Problems

  1. AnnotationFeature setters (e.g. SetGraphic(), SetStatus(), etc) and Store() wrapped in ApplyEdits() does not save edits to the database. No exceptions are thrown.
  2. AnnotationFeatureClass DeleteRows() wrapped in ApplyEdits() throws a geodatabase exception if Element field is null.

Workaround

Do not wrap annotation saves/deletes within ApplyEdits().

Is this the expected behavior?

(For full detail please see the attached PDF)

0 Kudos
6 Replies
RichRuh
Esri Regular Contributor

Hi Sung,

A few questions:

Did this code work in the file geodatabase where you created the data?

I'm a little confused by these two statements:

  • I have copied that annotation feature class from the file geodatabase to a branch versioned SQL

    Server Enterprise geodatabase using arcpy.FeatureClassToFeatureClass_conversion(), and

    included a few custom fields (e.g. long, text) using arcpy.AddField_management().

  • I have published my non-versioned annotation feature class as a feature service.

I think what you're saying is that the annotation feature class is added to a SQL Server enterprise geodatabase that uses branch versioning (presumably it's a utility network), but is itself not branch versioned.  

When you publish the annotation feature class to a feature service, is this a separate feature service?  Or are you attempting to put this in the same feature service as the utility network?

Thanks,

--Rich 

0 Kudos
SungBae
Emerging Contributor

Hi Rich,

I just tested this out in a file geodatabase, and it looks like I can make annotation save/delete perfectly fine within ApplyEdits(). So it seems like this issue arises when using a feature service.

You're assumptions from my two statements is correct. I have added an annotation feature class to a branch versioned SQL Server enterprise UN geodatabase but the annotation feature class itself is not versioned. Regarding those statements, I wanted to convey how I made my annotation feature class, and how I've included it into my enterprise gdb.

I am publishing this non-versioned annotation feature class as a separate feature service. I want it to be separate from the UN data feature service.

Let me know if you need any other information/clarifications.

Thanks,

Sung

0 Kudos
RichRuh
Esri Regular Contributor

Thank, Sung.  Let me try some experiments on my end and see what I get.

--Rich

0 Kudos
Aashis
by Esri Contributor
Esri Contributor

Sung BaeThanks for bringing this to our attention. We have logged the issue as a bug in our internal bug tracking system and development team will investigates the cause of this behavior. You can use the workaround until it is fixed.

0 Kudos
RichRuh
Esri Regular Contributor

This should be fixed in Pro 2.7.  Note that this behavior applies to all editing done inside Geodatabase.ApplyEdits() on services that do not support version management, not just annotation edits.

--Rich

0 Kudos
RichRuh
Esri Regular Contributor

This is fixed in the just-released ArcGIS Pro 2.7

0 Kudos