The WAL mode is persistent, so it is necessary to switch it to DELETE mode at least once (see https://www.sqlite.org/wal.html).
After that, it is not strictly necessary to execute PRAGMA journal_mode = DELETE again, but executing it is cheap and fast, and consistently executing it every time the connection is open avoids some potential future errors.
This PR fixes #8035.
The WAL mode is persistent, so it is necessary to switch it to DELETE mode at least once (see https://www.sqlite.org/wal.html).
After that, it is not strictly necessary to execute
PRAGMA journal_mode = DELETE
again, but executing it is cheap and fast, and consistently executing it every time the connection is open avoids some potential future errors.