If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?
Databases opened for write access with the bsddb module (and often by the anydbm module, since it will preferentially use bsddb) must explicitly be closed using the .close() method of the database. The underlying library caches database contents which need to be converted to on-disk form and written. If you have initialized a new bsddb database but not written anything to it before the program crashes, you will often wind up with a zero-length file and encounter an exception the next time the file is opened.
Related Questions
- We are trying to build a database and I get an error message that says "Inconsistency in NRMOL in FRBIO", and then the program crashes. What is going on?
- I am having problems editing database record in VCM - has an MLS program corrupted the VCM database?
- If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?