SQLite has the useful ability to provide an in-memory database that can be 
shared by multiple connections in the same process by opening the DB with the 
following syntax:

        rc = sqlite3_open("file:memdb1?mode=memory&cache=shared", &db);

I'm testing a database having this configuration in a unit test framework I 
have, and I'm finding that when I re-run the unit test, the data in the 
in-memory DB seems to still be around from the previous unit test run.  This 
sort of makes sense; the underlying idea here is something else in the same 
process can (re)-open the database via the same URI.

My questions are:

(a)     Is this right?  A shared-cache, in-memory database is "persistent" 
across connections from the same process that do not overlap in time?
(b)     Is there some way to reliably blow away one of these databases so I 
know there will be no hangover state after that operation and can start fresh 
with a virgin database?

Thanks in advance for any information or ideas.

Randall.


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to