[odb-users] deleting the underlying database while the program is running -- Windows

Boris Kolpackov boris at codesynthesis.com
Wed Dec 3 07:26:32 EST 2014


Hi Jeff,

Jeff Waller <truthset at gmail.com> writes:

> Some residual open connection pool file descriptor even though the
> database is deleted might explain this, or an underlying bug in the
> app that keeps some reference available; but whatever the reason it
> prevents deletion of the database file.

If you managed to delete the database instance, then this means all
the connections have been closed since the connection_pool's destructor
will wait for all the connections to be returned to the pool.

One thing that can happen (see documentation for sqlite3_close()) is
that SQLite might refuse to close the connection in certain cases. The
ODB runtime does assert(false) in this case so you may want to build
your application without NDEBUG defined and check that this is not
the cause of your problem (by default the VC++ Debug build is built
without NDEBUG and Release -- with).

Other than that, the only thing to try that I can think of is to call
sqlite3_shutdown() and see if that helps.

Boris



More information about the odb-users mailing list