A database with a journal mode of WAL must *always* have a WAL and SHM file when open and in use. The only way to not have them is to change the journal mode to something other than WAL.
A database with a journal mode of WAL must *always* have a WAL and SHM file when open and in use. The only way to not have them is to change the journal mode to something other than WAL.