Can shapefile locks by released through the API?

753
1
05-29-2011 09:49 PM
DrewMellor
New Contributor
Is it possible to release shapefile locks through the .NET API after processing the shapefile?

For example, there are lock files on the shapefile after executing the following, even though the table instance has gone out of scope and been disposed.

    string shapefile = "C\myshapefile.shp";
    ESRI.ArcGISExplorer.Data.Table tbl = ESRI.ArcGISExplorer.Data.Table.OpenShapefile(shapefile);
    using (tbl)
    {
foreach (ESRI.ArcGISExplorer.Data.Row row in tbl.GetRows())
{
     // do something
}
    }
           
Note that ESRI.ArcGISExplorer.Data.Row and ESRI.ArcGISExplorer.Data.RowCollection do not implement IDisposable and cannot be disposed.

The locks will prevent an external process from writing to the shapefile and - as far as I can tell - can only be released by closing ArcGIS Explorer or by changing the map document, which is not an option. How can I release the locks and allow the external proces to write to the shapefile?

In the arcpy (Python) library, you delete the cursor object and the lock is released. What is the equivalent in the ArcGIS Explorer API?
0 Kudos
1 Reply
AndreiIvanov
New Contributor III
This is not possible.
0 Kudos