Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Releasing feature class lock after editing

$
0
0
Basically, I've got an ArcMap project (ArcGIS version 10.0) with some custom buttons in it. One of the buttons uses ArcObjects to change the data source of several layers from a feature class in one File geodatabase to a similar feature class in a different File geodatabase. I've got it working so that this process releases any locks on the original feature class that was in the map (using FinalReleaseComObject). After the data source gets switched, the button also uses ArcObjects to delete the original feature class. All of this functionality works perfectly if no edits have been made to the data. The button is not enabled if you are editing.

The problem I'm having is, if the user does make some edits to the data and saves the edits, then the locks on this feature class will not be released until the ArcMap application is closed, even after my button has changed the layer's data source. I can manually remove the layers from the map, I can load a new or different map document from the File menu, but none of these things releases the lock on this feature class. Like I said, if the user has not made or saved any edits, this all works properly.

Any ideas on how I can get the lock to go away without closing the application window?

Viewing all articles
Browse latest Browse all 1374

Trending Articles