View Ticket
Not logged in
Ticket UUID: f39bf983c6f3bf47674f9d814efb70fbc2f06a56
Title: Generated database file is incompatible with Windows CE
Status: Closed Type: Incident
Severity: Important Priority: Medium
Subsystem: Native_Assembly Resolution: Works_As_Designed
Last Modified: 2014-02-06 18:49:06
Version Found In:
User Comments:
anonymous added on 2014-02-06 14:32:15:
I have System.Data.SQLite version 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
- 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.