Geodatabase.OpenAsync UWP File Lock

634
2
02-06-2017 02:32 PM
ChadYoder1
Occasional Contributor II

I have a page which shows maps which have been downloaded to the device.  The page shows the name, date and the number of edits in each map.  To show the edit count, the Gdb is opened using Geodatabase.OpenAsync.

On this page, the user can choose to open, sync or delete the map.

This works fine on iOS and Android, however on UWP the Geodatabase.OpenAsync creates a lock on the file when the page is loaded, and I can't seem to figure out how to release it so the user can delete the map.

Any ideas?

Thanks.

0 Kudos
2 Replies
AnttiKajanus1
Regular Contributor II

Hi Chad,

This is unfortunately an known issue at the moment. We are trying to get closing (and releasing the lock) easier in the future releases.

At the moment I would propose a workaround with this which kind of works. I would build UI experience so that it would remove the file but behind the scenes save information to the application that when opening the app next time, remove this data. It's not optimal but that's the best choice that you have.

Another thing that you can try to do is to make sure that all the references (layer etc..) are removed and out of scope and force GC but this might be hard to get right.

0 Kudos
ChadYoder1
Occasional Contributor II

Thanks Antti.

I tried the second option with no luck, so for now I'll go with the workaround.

0 Kudos