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

Jeff Waller truthset at gmail.com
Wed Dec 3 02:48:30 EST 2014


So perhaps a rare thing.  But we have an application that as an extreme fallback deletes all metadata including
the sqlite database being used.  It just simply deletes the entire directory  where all the metadata exists.  This is
done while the application is running but after all the threads that use the database are stopped and the database
object is destructed.

This has not been a problem because the application has historically been running on OS/X and Linux, but now
it’s been successfully ported to Windows as well, and the Windows OS prevents deleting files while the file
is still open by some program.

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.

We have a pretty wide latitude to change things, EXCEPT for stopping the app itself; that is not allowed.

Looking for any tips.

-Jeff



More information about the odb-users mailing list