SQLite Forum

Lua db:close deletes WAL file
- Different libraries

I tried using dynamic libsqlite3.so on C++ side and dynamic lsqlite3.so that is linked to dynamic libsqlite3.so and liblua.so. That makes possible using the same instance of sqlite3 library on C++ and Lua sides.

And, with such configuration the original problem with WAL file was solved.

P.S. Despite the fact that my case seems quite unique (android + NDK + lua + sqlite + wal mode), I still think, that such a situation should be somehow noted in documentation for Lua-sqlite lib. In my opinion, that's not obvious that using static libsqlite3 alongside static lsqlite3 (lsqlite3complete) could leed to such problems.

Link to lua.sqlite.org ticket:

- Different processes

However i'm still confused about "separate processes" part. I'll examine https://sqlite.org/howtocorrupt.html more thoughtfully.