|Title:||"database disk image is malformed" when using encryption in multithreaded situation|
|Last Modified:||2016-02-15 19:28:58|
|Version Found In:||18.104.22.168|
anonymous added on 2014-05-08 11:50:13:
When using an encrypted database in a multithreaded environment we experience "database disk image is malformed"-exceptions from time to time. A "pragma INTEGRITY_CHECK" afterwards confirms the corruption.
An C# example which reproduces the issue: http://pastebin.com/caj3Yn0Y This will create a test-database in the current directory, in which it will create, update and read randomized data. When run, the program crashes with the "image malformed"-exception on my Windows 7 quad core machine, usually within seconds.
The following work-arrounds seem to fix the issue:
This issue is observed with 22.214.171.124 with C++ runtime statically and dynamically linked, as well as 126.96.36.199 bundled version.
mistachkin added on 2014-05-08 17:26:32:
The CryptoAPI-based encryption included with System.Data.SQLite is a legacy feature, has known issues, and is officially unsupported. It is being retained only for the purpose of backward compatibility with legacy applications that make use of it. Alternatively, you might want to look into the commercial SEE extension, which does work with System.Data.SQLite and is fully supported for use with it.