Hello,
Our app asks users to log in to ArcGIS Online and uses OAuth access tokens to access content. Among other things, users can sync changes from a local geodatabase to a sync-enabled feature service hosted on ArcGis Online.
We're trying to support a use case where the user can log out and log in again, perhaps with a new identity. In this flow,
- on a successful log out, we want to delete any local geodatabase files that may have existed
- in the next successful login, we want to create new local geodatabase files for sync-enabled feature services that will be unique to the new user.
After implementing the code to do this, sync does NOT work with the new geodatabase file until a new app session is started after force-killing the old app session (I mention "force killing" to make it clear that backing out of the app all the way does not do it – you have to start a new app process).
The error message we get is
SQLite read only.: SQLite: 8
Attempt to write a readonly database
What this indicates to the best of our knowledge is that the previous geodatabase that we deleted is in use somewhere within the ArcGIS SDK and stays so until the app process is killed. We make sure to close out any map views that may be using the feature service layers before we delete the geodatabase file so we're not sure why this would be the case.
We've created a minimal patch to reproduce the issue based on the edit-and-sync-features example. Please see the patch zip attached to this ticket.