Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

schema locks with fGDB and python

$
0
0
Just wondering if anyone else has experienced the same as myself and if you have any thoughts/ideas.

I run a python script in a CMD shell running Windows 7 (ArcGIS 10.1).

The script sets the workspace to... arcpy.env.workspace = arcpy.env.scratchGDB

I copy a table from a given file GDB into the scratchGDB which is another file GDB.

I then attempt to add about 13 fields to the copied table in the scratchGDB.

This is the strange part. Often this will work but other times it fails indicating that it could get the schema lock necessary to add the a field.

If I didn't know better it almost seems like it's getting ahead of itself whilst looping and trying to get a schema lock before it's finished adding the previous field.

I do not have ArcGIS desktop running, and there does not seem to be any lock files in the scratchGDB prior to executing.

Other times it seems to fail while attempting to delete a table or FC from the scratchGDB. Same issue. Can't get the schema lock. Yet most of the time it works just fine when deleting tables/FC from the scratchGDB.

Thus far, using python has been a good experience except for the schema lock issues. it seems inconsistent and unpredictable.

Any suggestions or similar experiences welcome.

brian

Viewing all articles
Browse latest Browse all 2485

Trending Articles