Thanks very much Ralf. I have copied the whole database to another database not
using the WAL mode.
Stephan Hennekens
Wageningen Environmental Research (WENR), The Netherlands
Tel: +31 (0)317 485887 | Mobile: +31 (0)6 20921403 | WUR internal: 85887
-----Original Message-----
From: yunqa-bounce@xxxxxxxxxxxxx <yunqa-bounce@xxxxxxxxxxxxx> On Behalf Of
Delphi Inspiration
Sent: vrijdag 16 december 2022 15:44
To: yunqa@xxxxxxxxxxxxx
Subject: [yunqa.de] DISQLite3: Unwanted *.db-shm and *.db-wal files
If you see the files *.db-shm and *.db-wal next to your SQLite database file it
is because your database is in WAL mode and a) is in active use or b) did not
shut down cleanly after use.
From the SQLite documentation:
"If the last client using the database shuts down cleanly by calling
sqlite3_close(), then a checkpoint is run automatically in order to transfer
all information from the wal file over into the main database, and both the shm
file and the wal file are unlinked. Thus, when the database is not in use by
any client, it is usually the case that only the main database file exists on
disk. However, if the last client did not call sqlite3_close() before it shut
down, or if the last client to disconnect was a read-only client, then the
final cleanup operation does not occur and the shm and wal files may still
exist on disk even when the database is not in use."
Another way to omit the *.db-shm and *.db-wal files is to set exclusive locking
mode.
So if you never ever want SQLite to create those files you must either
a) ensure the database never enters WAL mode or
b) ensure that exclusive locking it set.
Ralf
On 16.12.2022 11:40, Hennekens, Stephan wrote:
Is there an option to prevent Sqlite from creating *. db-shm and >_______________________________________________
*..db-wal files. Otherwise I cannot use the Program Files (x86) > folder
for storing databases.