problems overwriting files in ArcSDE with python script

المشرف العام

Administrator
طاقم الإدارة
I'm having a great deal of difficulty overwriting files when using ArcSDE. The usual 'arcpy.env.overwriteOutput' method doesn't seem to work.

When I run this script:

import arcpyfrom arcpy import envenv.workspace = "L:\\DRAINAGE\\D_GROUP6\\STAFF\\CJE\\EDRN_3.sde"arcpy.env.overwriteOutput = Trueselected_link = "L:\\DRAINAGE\\D_GROUP6\\STAFF\\CJE\\EDRN_3.sde\\VALLAHC.EDRN_LINK6"q_fid = 39edrn_node = "L:\\DRAINAGE\\D_GROUP6\\STAFF\\CJE\\EDRN_3.sde\\VALLAHC.EDRN_NODE6"join1 = "L:\\DRAINAGE\\D_GROUP6\\STAFF\\CJE\\EDRN_3.sde\\VALLAHC.join39"arcpy.MakeFeatureLayer_management(selected_link, "feature_layer10") arcpy.SelectLayerByAttribute_management("feature_layer10", "NEW_SELECTION", '\"OBJECTID_1\" = {0}'.format(q_fid))arcpy.SpatialJoin_analysis("feature_layer10", edrn_node, join1, "JOIN_ONE_TO_MANY", "#", "#", "CONTAINS")I get the following error:

Runtime error : ERROR 000601: Cannot delete L:\DRAINAGE\D_GROUP6\STAFF\CJE\EDRN_3.sde\VALLAHC.join39. May be locked by another application. Failed to execute (SpatialJoin).I have attempted to get around this in a number of ways:

  1. versioning/not versioning the data.
  2. Checking/unchecking the overwrite geoprocessing operations box in geoprocessing options.
  3. Using 'arcpy.Delete_management()' to delete the join at the end of the script. But SDE won't let me and outputs the same 000601 error.
So, does anybody have any ideas on how to get around this? My script works fine when I use shapefiles or a regular geodatabase. I'm thinking there must be something I've missed related to SDE that I'm not aware of as I don't have much experience with databases.



أكثر...
 
أعلى