WAL/SHM files do not get deleted with ReadOnly flag
(1.1) Originally by Vladimir (I-Vladimir) with edits by Richard Hipp (drh) on 2021-09-08 13:47:31 from 1.0 [link] [source]
Hi, Open/Close ReadWrite - wal file deleted. Open/Close ReadOnly - wal/shm files retained. Is that by design? Thanks
The 'ReadOnly' status tells SQLite that it should not make any changes.
(3) By Vladimir (I-Vladimir) on 2021-09-08 19:52:39 in reply to 2 [source]
I agree, but with ReadWrite FullMitex option set, wal file get created and deleted with Close, while ReadOnly close doesn't delete it leaving impression that there still open connection.
That would be a mistaken impression. It would be perspicacious to keep track of whether a connection is open or not directly rather than by relying on magical signals from the gods.
Sometimes when a connection is closed it is sunny out, sometimes it is not. Whether or not the sun is shining (like testing whether or not the WAL file exists) is not a recommended way to tell if a connection is open.