Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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")

# Second geoprocessing    

fc_list = arcpy.ListFeatureClasses()
for fc in fc_list:     
share|improve this question

You are trying to copy features back to themselves. See the documentation on CopyFeatures_management for correct usage. Your in features should be different to your output feature class. That is most likely why you are getting a lock.

In the first Geoprocessing, change the output feature class to something else. Do the same to the second Geoprocessing.

share|improve this answer
@lemuel I think that you should Accept this answer. – PolyGeo Apr 18 '14 at 7:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.