Select to view content in your preferred language

Geodatabase.OpenAsync UWP File Lock

1091
2
02-06-2017 02:32 PM
ChadYoder1
Frequent Contributor

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
Deactivated User

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
Frequent Contributor

Thanks Antti.

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

0 Kudos