"Roger Binns" <[EMAIL PROTECTED]> wrote: > I'd like to use sqlite3_enable_shared_cache in > my APSW wrapper but I can't see a sensible > safe way of doing it. The wrapper already enforces > the conditions mentioned in the doc (all operations > on a handle happening in the same thread). > > It looks like I'd have to do a lot of housekeeping > calling sqlite3_enable_shared_cache just before the > first sqlite3_open in a thread and just after the > last sqlite3_close. > > Is SQLite already tracking these? Why can't I > call enable on every sqlite3_open and have it > just succeed if sharing is already setup?
If you call sqlite3_enable_shared_cache while another connection is open, you will get an SQLITE_MISUSE error. But you can ignore that error if you want. > > Will the last sqlite3_close not clean up the > shared cache anyway? > It will. -- D. Richard Hipp <[EMAIL PROTECTED]>