My application stores users datas in a SQLite database located in File.Dirinternal. (and initially downloaded from Dropbox at login creation)
When I upload this DB to Dropbox from this File.Dirinternal, all tables are empty while datas are populated in the application (!)
Is there a magical property of File.Dirinternal I missed somewhere ?
It's like there is another "shadow" copy of this DB where datas are populated ?!
Code to upload is quite simple :
B4X:
Dim filename As String
filename="/Users/DIR_" & sf.Trim(sf.Upper(email.Text))
If File.Exists(File.DirInternal,"poidsww.db") Then
dbx.upload(File.DirInternal,"poidsww.db",filename,"poidsww.db")
End If
Please use [CODE]code here...[/CODE] tags when posting code.
I never copied a sqlite db from the device to my dropbox but i would make sure the DB is Closed before uploading.
- Close the DB
- Wait a few ms (sleep(500))
- Upload the db to dropbox
- Reopen DB
Here is the return.
My DB is last line + these 2 strange lines with "-shm" and "-wal"
When I copy these 3 files instead of just ".db" it works like a charm !!
I found here (https://www.sqlite.org/tempfiles.html) some explanations about these temporary files :
-SHM is Shared Memory file
- WAL is Write-Ahead Log
I never copied a sqlite db from the device to my dropbox but i would make sure the DB is Closed before uploading.
- Close the DB
- Wait a few ms (sleep(500))
- Upload the db to dropbox
- Reopen DB