Hi,
I'm working on some scripts to help with a database migration. Basically just a collection of "final load" scripts when we switch over, so we are not trying to load data individually for all of our features and tables.
The new databases are branch-versioned, we are switching from traditional versioning. Our existing on-prem DB is postgresql 9.6, we are moving to an aws DB, postgresql 12.11.
Trying to test with some simple appends is not working, I'm getting error 160250.
ERROR 160250: Objects in this class cannot be updated outside an edit session
Failed to execute (Append).
I tried using the editor class to see if that would work:
I don't know if you ever found an answer to this issue elsewhere, but If you want to use arcpy to edit branch versioned data directly from the EGDB, you need to be connected as the data owner (if you're not already). You should also reserve operations performed against branch versioned data directly through the SDE connection to bulk loading ops like what you're doing: truncate, append, etc.
For these bulk load ops, with versioned EGDB data, you need to specify multiuser_mode=True when instantiating the arcpy.da.Editor() class or the .startEditing() method for edits to work.
To perform other edits (and it's recommended all edits happen this way), you should use the ArcGIS API for Python. Specifically, through the VersionManager.