I am trying to work on making bulk inserts and deletes but I am having trouble releasing the write lock on the table. I made a small sample project with only one insert to test the lock and the lock remains even after the table calls FreeWriteLock. The lock is only removed when the Geodatabase object is closed or disposed of. I want the lock to be removed when table calls FreeWriteLock.
Using File Geodatabase API 1.4
Here is a sample of my code:
public void InsertRow()
{
using (Geodatabase geodatabase = Geodatabase.Open(DestinationDBPath))
{
using (Table table = geodatabase.OpenTable("Points"))
{
table.LoadOnlyMode(true);
table.SetWriteLock();
using (Row row = table.CreateRowObject())
{
table.Insert(row);
}
table.LoadOnlyMode(false);
table.FreeWriteLock(); //Lock still remains after this call...why??
}
}
}