If the actual return code from SQLite ist SQLITE_BUSY, this would indicate that whatever you are doing to "write to the database" is not properly closing the Transaction. E.g. you (or the wrapper) are doing BEGIN; INSERT …; and/or UPDATE …; and never get round to COMMIT; or ROLLBACK; and terminating the IIS Session will imply ROLLBACK, i.e. the data you were writing has "misteriously disappeared" when you reconnect.