Tuesday, 6 August 2013

SQLite doesn't recreate deleted database in shared mode

SQLite doesn't recreate deleted database in shared mode

I opened a SQLite database using sqlite3_open_v2 with SQLITE_OPEN_CREATE
and SQLITE_OPEN_SHAREDCACHE set. When my program (which is a browser
extension) is removed, the database is closed and the database file is
deleted.
However, it is possible to reinstall the program without quitting the
active process (which is the browser). When this happens, it tries to
recreate the browser using the same sqlite3_open_v2 call. The call
succeeds but the physical database file is not recreated.
I assume there is a problem with the shared cache since the problem
doesn't occur if I don't specify SQLITE_OPEN_SHAREDCACHE. But I really
need to delete the physical database file if my program is uninstalled. Is
there some way to do so that informs SQLite so it knows to clean up the
shared cache as well?

No comments:

Post a Comment