|Title:||Generated database file is incompatible with Windows CE|
|Last Modified:||2014-02-06 18:49:06|
|Version Found In:||22.214.171.124|
anonymous added on 2014-02-06 14:32:15:
I have System.Data.SQLite version 126.96.36.199 for Win32-2008 and PocketPC-ARM-2008. The former is used to create an empty database during the build process for the latter. However, the generated database file is incompatible with Windows CE (file is encrypted or is not a database) while working normally under Windows. I found the reason to be a "PRAGMA journal_mode=WAL". My method is: - Create the database file - Connect to the database file - Issue a bunch of configuration PRAGMAs (page_size, journal_mode, encoding, foreign_keys, locking_mode) - Apply the schema - ANALYZE - PRAGMA wal_checkpoint - Close When applied on Windows CE, the generated database file works on both platforms and WAL works as expected. When generated on Windows, the file works on Windows, but fails on Windows CE. The only difference between both database files is in the SQLite header at offset 18 and 19 (write version and read version). In the Windows CE generated it's 1 ("legacy"), in the Windows version it's 2 ("WAL"). When I don't use the PRAGMA journal_mode=WAL on Windows, the database file is "legacy" and Windows CE can use it, including WAL functionality. Why doesn't Windows CE support the write and read version 2?
mistachkin added on 2014-02-06 18:46:48:
Older versions of Windows CE do not support WAL mode and they are compiled with SQLITE_OMIT_WAL by default.