Select to view content in your preferred language

Python start editing session

3470
3
09-01-2010 05:59 AM
ShaneLim
Deactivated User
I was pretty sure there was a way to start an editing session in python. I am using 9.3 and I just cant seem to find it. I was sure it was something like gp.starteditingsession or something like this. Am I wrong? Is it just a vb thing? I am working on an sde versioned dataset and my scripts are not making it into the data so I think I need an editing session.

Shane
0 Kudos
3 Replies
JohnHauck
Frequent Contributor
The Geoprocessor does not contain anything to start an edit session. Here is a link to the Geoprocessor programming model:

http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Geoprocessor_programming_model


I know of a couple of bugs that are somewhat related to this description. Does your code work correctly if using a non-versioned copy of the same data? Are you running the script from a toolbox in ArcMap or as a stand alone script?

Not sure if these were an issue at 9.3 but worth looking into:
http://resources.arcgis.com/content/kbase?fa=articleShow&d=28084

http://resources.arcgis.com/content/nimbus-bug?bugID=TklNMDQ4MjI1

If that doesn't help get you going provide some additional details about the workflow, code sample, SDE version, RDBMS flavor, ect.

Hope this helps!
0 Kudos
ShaneLim
Deactivated User
Ok thanks for that. I must have gotten my python, vba, and vb.net mixed up agian.

I have SDE and versioned datasets that I am trying to update. If I start an edit session and run the script from toolbox pointing to the version I am currently editing and then hit save edits after it runs my changes make it into the data otherwise they won't make it. I was hoping to be able to start the editing stuff from withing python but this work around will have to do. Thanks for the links they were helpful.

Shane
0 Kudos
ShaneLim
Deactivated User
I must have spoken too soon. When I tested the script on sqlexpress running sde personal on a versioned dataset in edit it works. Running the script from the toolbox on a version that is SDE running on oracle i beleive Enterprise advanced SDE With or without an edit session I get no updates. However I can't run the script a second time because it thinks the updates were done. Unless I completely shut down ArcMap and ArcCatalog and restart them. Then I can run the script again. Are there some guidlines about working python with SDE targeting specific versions?

Shane
0 Kudos