When an IIS application is restarted (e.g. a configuration file has changed) the .net part of the SQLite dll is unloaded but the native part remains. When the application then reloads the SQLite dll an exception is thrown whilst creating the SQLiteFactory. I believe I have traced the problem to "SetLogCallback" which then fails on the following native line:
if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT;
Maybe this could be fixed by shutting down SQLite in the static constructor of SQLiteLog?
mistachkin added on 2011-07-21 21:48:11 UTC:
This issue has been "fixed" by check-in [1d024437e5]; however, the fix is preliminary and may be modified in the future.