Select to view content in your preferred language

What is best practice for editing features with arcpy in branch-versioned enterprise DB, getting error 160250

446
0
06-16-2023 11:08 AM
AaronManuel2
New Contributor III

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:

                        edit.startEditing(False,True)

                        edit.startOperation()

                        arcpy.management.DeleteRows(fpath)

                        arcpy.management.Append(prem_path,fpath,"NO_TEST" )

                        edit.stopOperation()

                        edit.stopEditing(True)
 
Same error. I then tried testing editing through a service since that is how branch versioning is supposed to work, but that doesn't work either. But maybe with the service there is a schema lock?
 
I'm guessing there is something about the branch versioning that is tripping things up here. My question is how am I supposed to do this with arcpy on a branch-versioned DB? Is this something I need to do on the Postgres side instead?
 
Thanks,
 
 

 

Tags (2)
0 Kudos
0 Replies