SQLite Forum

Why data is lost in SQLite database with WAL mode on when connection is not closed properly?
Login
Thanks for reply! I'll check the cases that you've suggested and come back with results.

The one issue here is case B.2). Most of the time i don't have -wal and -shm files on my Android device (at least at the /data/data/com.package.my/files directory). To elaborate: SOMETIMES i see the files near the main db file. But most of the time -wal file is empty.

To sum up, after inserting several transactions in WAL mode i see:

Most often:
/data/data/com.package.my/files/

- db.sqlite3
- db.sqlite3-wal (0 bytes)
- db.sqlite3-shm (32 bytes)


A bit less often:
/data/data/com.package.my/files/

- db.sqlite3
- db.sqlite3-wal (DON'T EXIST)
- db.sqlite3-shm (DON'T EXIST)


SEEN ONE TIME for all the tesing period (around 2 weeks)
/data/data/com.package.my/files/

- db.sqlite3
- db.sqlite3-wal (3,4 mb)
- db.sqlite3-shm (32 bytes)