[gdal-dev] ds.DeleteLayer(idx) "failed: database table is locked"

Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] jesse.r.meyer at nasa.gov
Thu Jan 30 10:34:33 PST 2025


Hi,

Trying to remove superfluous intermediate layers in a GPKG dataset.  The general logic is

Ds = ogr.open(fp)
Lyr = ds.executesql(query)
Ds.DeleteLayer(idx) <- failed, database table is locked, may be caused by “sqlite3_exec(DROP TABLE “rtree_layername_geom”) failed: database table is locked

Is layer deletion not supported while a “result set” from a SQL query is on the dataset is active?  Perhaps importantly, the query sources the deleted layer.

GDAL v3.9.3

Best,
Jesse

Lead Computer Scientist
Science Systems and Applications, Inc.
Dr Compton Tucker Team
NASA Goddard Space Flight Center
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250130/4dc17380/attachment-0001.htm>


More information about the gdal-dev mailing list