Fixing cache issues - sqlite3 not thread safe