The following code puts an sr.lock on each table in my List. What’s causing my tables to lock up?
I understand my script is reading or opening my tables temporarily to perform the “MakeRouteEventLayer_lr” Geoprocessing but since I’m not necessarily inserting a cursor I should not have to delete references to a table right?
As a result of my tables locking up while running the “MakeRouteEventLayer_lr()”, I am not able to run the second Geoprocessing tool “arcpy.AddXY_management()”.
Currently, in order to accomplish my task I have to run each of the Geoprocessing as a standalone process and even then the tables are locked once they finish processing.
I would greatly appreciate it if someone can help me isolate this problem. By the way my source data is in a file geodatabase. I've ran the code below in pythonWin and ArcMap with the same results.
# First Geoprocessing Table_List = arcpy.ListTables() for t_list in Table_List: arcpy.MakeRouteEventLayer_lr(PODS_ROUTEM, "ROUTE_CODE", t_list, "Route_Code POINT measure", t_list+'_EVENT', "", "NO_ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT") arcpy.CopyFeatures_management(t_list+'_EVENT',t_list+'_EVENT') # Second geoprocessing fc_list = arcpy.ListFeatureClasses() for fc in fc_list: arcpy.AddXY_management(fc) arcpy.CopyFeatures_management(fc,fc)