AnsweredAssumed Answered

How do you remove .geodatabase file while App is running?

Question asked by fimpe001 on Nov 22, 2015
Latest reply on Nov 23, 2015 by fimpe001

I have an AppStudio app that generates+syncs a runtime geodatabase from a feature service and then displays some layers on a map. How can I give my users the ability to remove that .geodatabase file while the app is running?

 

In my app I have a button that when clicked:

1) removes all FeatureLayers from the map

2) changes all GeodatabaseFeatureTables to not point to my .geodatabase file anymore

 

Then it executes FileFolder.removeFile("gdb.geodatabase"), but it fails to delete the file!

 

In my code I do declare a QML Geodatabase component that uses the "gdb.geodatabase" file, and when I comment that section out the file does indeed get deleted successfully. Can I modify my Geodatabase component to not prevent the deletion of my .geodatabase file while the app is running? I tried changing the Geodatabase "path" property but that doesn't seem to release the lock.

 

Thanks for you advice.

Outcomes