Skip to main content
Question

Error writing to Temp GeoDatabase using Arcpy via Python Caller

  • February 27, 2025
  • 2 replies
  • 26 views

brad
Contributor
Forum|alt.badge.img+1

Hello there, 

I am trying to execute some Python using the ArcPy module in a workbench base on this Tutorial, Using Arcpy for FME Feature Processing, but I am getting this error the following error:

Geodatabase Error (-2147220970): Cannot acquire a schema lock because of an existing lock.
Could not open File Geodatabase dataset `C:\Users\’USERNAME’\AppData\Local\Temp\wbrun_1740499345598_2444\fmetmp_24\1740665793794_2528_d\tor470\temp.gdb' for reading
Failed to obtain any schemas from reader 'FILEGDB' from 1 datasets. This may be due to invalid datasets or format accessibility issues due to licensing, dependencies, or module loading. See logfile for more information

 

It the issue seems to be the GeoDatabase is still “open” in memory, but my Google Fu has failed to come up with a fix

2 replies

donalmateer
Safer
Forum|alt.badge.img+5

Hi ​@brad,

Thanks for reaching out! 
After some quick investigation I found that this could be related to cleaning up your arcpy script.

  • ArcPy maintains locks when cursors, layers, or maps are open.
  • Explicitly delete references at the end of the script.

At the end of your script, add: arcpy.ClearWorkspaceCache_management()

Let me know if this helps!
 


j.botterill
Influencer
Forum|alt.badge.img+34
  • Influencer
  • March 11, 2025

You will probably not get this error in FME if you turn ‘feature caching’ off in workbench. This article gave me alot of knowledge when I was calling ArcPy to process feature classes in a file Geodatabase from FME https://support.safe.com/hc/en-us/articles/25407493532429-Using-Arcpy-for-FME-Feature-Processing


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings