### Use WAL Mode

WAL Mode
If you want to use Write-Ahead Loggging journaling mode (also called WAL), read here:
http://www.sqlite.org/wal.html
When creating a new database, call
'SQLite connections should be shared directly, without a pool.
Public gSQL As SQL
'Open the SQLite Database located in the DirApp folder
gSQL.InitializeSQLite(File.DirApp, "MySQLIteDatabase", True)
'Set the journal_mode. Options are DELETE|WAL with default DELETE
gSQL.ExecNonQuery("PRAGMA journal_mode=WAL")
'Consider to set to FULL if lower speed is required
'Set the synchronous mode. Options are NORMAL|FULL with default FULL
gSQL.ExecNonQuery("PRAGMA synchronous=NORMAL")
Best mode for multithreaded apps
gSQL.ExecNonQuery("PRAGMA journal_mode=WAL")
gSQL.ExecNonQuery("PRAGMA synchronous=NORMAL")
Hints WAL
WAL mode creates two additional disk files
mysqlitedatebase.sqlite-shm
mysqlitedatebase.sqlite-wal
File size for the -wal file is controlled by PRAGMA:
wal_autocheckpoint=N default=1000 pages
Hints Synchronous
Synchronous=FULL protects against power failures.

Changed: , Category: SQLite, File: T6C254M1834.htm, ID: 1834