On Friday, 28 June, 2019 07:37, Thomas Kurz <sqlite.2...@t-net.ruhr> wrote:

>> A WAL file left behind is a sign of a problem in the app which
>should be corrected.

>I have exactly this problem and don't like the SHM and WAL files
>being left behind. I have even tried "pragma wal_checkpoint(full)"
>before closing the connection, but there are still situations where
>the WAL file remains.

>Is there anything else I can do ensure that these files are removed?

https://sqlite.org/c3ref/close.html

This would mean that you have not finalized all prepared statements, closed all 
blob handles, and finished all backups -- ie, that you are exiting the program 
while there are still open objects which are connected to the database (ie, you 
are in effect crashing the program, not exiting cleanly).

Unless of course you have set the sqlite_db_config option that does not 
checkpoint on close ...

Change the sqlite3_close_v2 to sqlite3_close and check the return code is 
SQLITE_OK.  If not, you can use sqlite3_next_stmt to find the statements that 
are not finalized and try again.

https://sqlite.org/c3ref/next_stmt.html


-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to