I've solved my problem. I incorrectly assumed that this was some kind of usual ArcMap behavior, and I simply needed to find a way to deal with it. 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.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. After doing this, it worked fine, the locks were going away even after saving edits. I reinstalled my current project and it still worked fine. Using the process of elimination, I narrowed the problem down to an add-in called Attribute Assistant, from ESRI's water utilities team. 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. They have also updated it a number of times since I installed it, so maybe it's fixed.
I believe that this behavior may not actually have anything to do with my code. I can very easily reproduce the problem with simple File geodatabase and a single feature class:Add the feature class to ArcMap. You can see the lock files created in the GDB's folder. Remove the feature class from ArcMap and the lock files go away.Now, add the feature class to ArcMap, make some edit, then save edits and stop editing. Remove the feature class from ArcMap and the lock files will not go away. Closing ArcMap will remove them.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.If you still think that posting some code would help, I can certainly put something together.
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.