Does the problem go away if you use ":memory:" as the database file name? That is make a transient, in-memory database.