SQLite Forum

Why data is lost in SQLite database with WAL mode on when connection is not closed properly?
> What should i add

Working code that we can compile and run to see the problem.  The code
fragment you supplied in your original post appears to be incomplete.
In other words, send in a reproducible test case.