When calling the MakeFeatureLayer function in a python script, a lock file is created that may persist even after the script finishes. To remove the lock file, just call arcpy.Delete_management(layer) before the script terminates.
This forum post provided the answer to this problem.
Thanks, my program was not releasing the lock after running spatial queries on a shape file. This solved it.
ReplyDelete