[yunqa.de] Re: DISQLite3: Unwanted *.db-shm and *.db-wal files

  • From: "Hennekens, Stephan" <stephan.hennekens@xxxxxx>
  • To: "yunqa@xxxxxxxxxxxxx" <yunqa@xxxxxxxxxxxxx>
  • Date: Fri, 16 Dec 2022 15:42:10 +0000

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.
_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.freelists.org%2Flist%2Fyunqa&amp;data=05%7C01%7Cstephan.hennekens%40wur.nl%7C79744c44fb5a447fcb7c08dadf73fed7%7C27d137e5761f4dc1af88d26430abb18f%7C0%7C0%7C638067986554914187%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=BcRk3x3pJblCHoTeZIV6vtqcCcyidTa053NcmEQHEyk%3D&amp;reserved=0



_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: