I am using GDAL with c# and run into a problem deleting datasource files
after running ExecuteSQL.
The key here is that a datasource is opened implicitly via the JOIN
statement. An implicitly opened shapefile (here node3109.shp) remains locked
after the datasource has been closed.
Opening the file upfront does not help either. Here is the c# code snippet:
using (DataSource datasource = OSGeo.OGR.Ogr.Open(pipeFile, 0))
string statement =
"SELECT p.id, n.grnd_lvl FROM pipe3109 p " +
"LEFT JOIN 'node3109.shp'.node3109 n ON n.node_id = p.ds_node_id";
using (Layer layer = datasource.ExecuteSQL(statement, null,