<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Releasing feature class lock after editing in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164440#M4276</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply, Alexander.&amp;nbsp; I don't know if this matters, but I should clarify that any potential edits that I'm talking about here would be performed with the standard editing tools in the ArcMap UI, not anything performed in my code.&amp;nbsp; I do use FinalReleaseComObject after certain tasks to remove locks, it just doesn't work the same way if the data has been edited.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jan 2013 19:44:23 GMT</pubDate>
    <dc:creator>RyanKelso</dc:creator>
    <dc:date>2013-01-30T19:44:23Z</dc:date>
    <item>
      <title>Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164436#M4272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Basically, I've got an ArcMap project (ArcGIS version 10.0) with some custom buttons in it.&amp;nbsp; 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.&amp;nbsp; I've got it working so that this process releases any locks on the original feature class that was in the map (using FinalReleaseComObject).&amp;nbsp; After the data source gets switched, the button also uses ArcObjects to delete the original feature class.&amp;nbsp; All of this functionality works perfectly if no edits have been made to the data.&amp;nbsp; The button is not enabled if you are editing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; 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.&amp;nbsp; Like I said, if the user has not made or saved any edits, this all works properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on how I can get the lock to go away without closing the application window?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 15:16:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164436#M4272</guid>
      <dc:creator>RyanKelso</dc:creator>
      <dc:date>2013-01-30T15:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164437#M4273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post code? A small project that reproduces the problem using the sample data ESRI delivers would be the most helpful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 17:57:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164437#M4273</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2013-01-30T17:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164438#M4274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe that this behavior may not actually have anything to do with my code.&amp;nbsp; I can very easily reproduce the problem with simple File geodatabase and a single feature class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Add the feature class to ArcMap.&amp;nbsp; You can see the lock files created in the GDB's folder.&amp;nbsp; Remove the feature class from ArcMap and the lock files go away.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, add the feature class to ArcMap, make some edit, then save edits and stop editing.&amp;nbsp; Remove the feature class from ArcMap and the lock files will not go away.&amp;nbsp; Closing ArcMap will remove them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm wondering, maybe there is some method that gets fired off when ArcMap is closed (that I have no clue about), which finally releases the locks after a feature class has been edited, and if it would be something I could incorporate into my code so I wouldn't have to close ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you still think that posting some code would help, I can certainly put something together.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 18:32:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164438#M4274</guid>
      <dc:creator>RyanKelso</dc:creator>
      <dc:date>2013-01-30T18:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164439#M4275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcMap keeps some COM objects alive after the edit session that have the locks.&amp;nbsp; When ArcMap is shutdown, the objects are destroyed which removes the locks.&amp;nbsp; ESRI's locking and especially failure to release locks has driven me crazy for years.&amp;nbsp; If you keep a reference to the featureclasses, workspace and any other objects accessed in your code and explicitly call marshal.ReleaseCOmObject (or even a finalRelease) after the layers have been removed, you may be able to release the locks.&amp;nbsp; Beware if you use the undo function after removing the layer to get it back, you might get unexpected results.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 19:22:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164439#M4275</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2013-01-30T19:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164440#M4276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply, Alexander.&amp;nbsp; I don't know if this matters, but I should clarify that any potential edits that I'm talking about here would be performed with the standard editing tools in the ArcMap UI, not anything performed in my code.&amp;nbsp; I do use FinalReleaseComObject after certain tasks to remove locks, it just doesn't work the same way if the data has been edited.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 19:44:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164440#M4276</guid>
      <dc:creator>RyanKelso</dc:creator>
      <dc:date>2013-01-30T19:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164441#M4277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I believe that this behavior may not actually have anything to do with my code.&amp;nbsp; I can very easily reproduce the problem with simple File geodatabase and a single feature class:&lt;BR /&gt;&lt;BR /&gt;Add the feature class to ArcMap.&amp;nbsp; You can see the lock files created in the GDB's folder.&amp;nbsp; Remove the feature class from ArcMap and the lock files go away.&lt;BR /&gt;&lt;BR /&gt;Now, add the feature class to ArcMap, make some edit, then save edits and stop editing.&amp;nbsp; Remove the feature class from ArcMap and the lock files will not go away.&amp;nbsp; Closing ArcMap will remove them.&lt;BR /&gt;&lt;BR /&gt;I'm wondering, maybe there is some method that gets fired off when ArcMap is closed (that I have no clue about), which finally releases the locks after a feature class has been edited, and if it would be something I could incorporate into my code so I wouldn't have to close ArcMap.&lt;BR /&gt;&lt;BR /&gt;If you still think that posting some code would help, I can certainly put something together.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It sounds to me like some of the editing commands are causing memory to be leaked. I can show you how to pinpoint that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/75186-Memory-leak-with-FeatureClass-object?p=263735#post263735"&gt;http://forums.arcgis.com/threads/75186-Memory-leak-with-FeatureClass-object?p=263735#post263735&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark memory before and after running an edit command that causes the lock files to stop going away. Then, diff the marks and look for things like calls to Clone methods or other calls that might prevent a geodatabase from closing by holding on to a reference. Try marking with and without the -g flag (you need to be consistent on the marks you diff--don't use -g on the before and after marks, then use -g on the before and after marks) Please post your results or ask questions if you need help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 21:05:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164441#M4277</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2013-01-30T21:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164442#M4278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've solved my problem.&amp;nbsp; I incorrectly assumed that this was some kind of usual ArcMap behavior, and I simply needed to find a way to deal with it.&amp;nbsp; Thank you for your replies, Jason, while I didn't go through the debugging process you suggested, you did get me thinking along the correct lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I have a number of other ArcMap add-ins installed on my machine, I decided to uninstall all of them then test for this behavior.&amp;nbsp; After doing this, it worked fine, the locks were going away even after saving edits.&amp;nbsp; I reinstalled my current project and it still worked fine.&amp;nbsp; Using the process of elimination, I narrowed the problem down to an add-in called Attribute Assistant, from ESRI's water utilities team.&amp;nbsp; Maybe there is a memory leak, as Jason suggested, but I didn't look into it further since I don't need the Attribute Assistant anymore.&amp;nbsp; They have also updated it a number of times since I installed it, so maybe it's fixed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 17:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164442#M4278</guid>
      <dc:creator>RyanKelso</dc:creator>
      <dc:date>2013-01-31T17:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Releasing feature class lock after editing</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164443#M4279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've solved my problem.&amp;nbsp; I incorrectly assumed that this was some kind of usual ArcMap behavior, and I simply needed to find a way to deal with it.&amp;nbsp; Thank you for your replies, Jason, while I didn't go through the debugging process you suggested, you did get me thinking along the correct lines.&lt;BR /&gt;&lt;BR /&gt;Since I have a number of other ArcMap add-ins installed on my machine, I decided to uninstall all of them then test for this behavior.&amp;nbsp; After doing this, it worked fine, the locks were going away even after saving edits.&amp;nbsp; I reinstalled my current project and it still worked fine.&amp;nbsp; Using the process of elimination, I narrowed the problem down to an add-in called Attribute Assistant, from ESRI's water utilities team.&amp;nbsp; Maybe there is a memory leak, as Jason suggested, but I didn't look into it further since I don't need the Attribute Assistant anymore.&amp;nbsp; They have also updated it a number of times since I installed it, so maybe it's fixed.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Good information! Thanks for posting your solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 17:40:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/releasing-feature-class-lock-after-editing/m-p/164443#M4279</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2013-01-31T17:40:42Z</dc:date>
    </item>
  </channel>
</rss>

