Hi,
I'm getting an exception "data_source is already owned" when create a FeatureLayer from a local FeatureTable. In my situation I had already created another FeatureLayer (in another Map) based on the same FeatureTable. I believe this relates to .geodatabase locking.
I have just begun investigating, but I am curious if anyone else is setting this, and more importantly if there are known steps to avoid this.
Thanks,
-Cory
Here is something that works. I haven't worked out which steps are essential, but it does seem to work.
if (MapViewModel.Map != null)
{
MapViewModel.Map.OperationalLayers.Clear();
// just sets Geodatabase references to null
_geodatabaseFactoryService.ReleaseGeodatabases();
GC.Collect();
GC.WaitForPendingFinalizers();
}