The database on file is left in an bad state after inserting a large number of entries at once in a BTREE database. This happens when: a) multiple databases are open in a file, b) the dbtype is DB_BTREE, c) a large volume of key + data is inserted in the database. The volume varies with the pagesize of the database. No error is raised on insertion. However, if we check the database file after insertion, we get the following error: (-30980, 'DB_VERIFY_BAD: Database verification failed -- Subdatabase entry references page 4 of invalid type 5'). Moreover, running the test suite from bsddb module yields 6 failures and 2 errors (see the 'bsddb_testrun.txt' attachment). The error condition can be verified easily with the 'testdb.py' script - see attachments). It was run with Python 2.3.3 and 2.3.4 on Windows XP, also with Python 2.3.4 the cygwin version and Python 2.3+ on Suse Linux 9.0.
Logged In: YES user_id=74879 This happens when you open multiple databases inside a single file without creating a database environment. With the following code, your sample works. import bsddb.db as db file = "test.db" dbenv=db.DBEnv() dbenv.open(None,db.DB_CREATE|db.DB_INIT_MPOOL) DB = db.DB(dbenv) DB1 = db.DB(dbenv) DB.open(file, "one", db.DB_BTREE, db.DB_CREATE) DB1.open(file, "two", db.DB_BTREE, db.DB_CREATE) for i in range(10000): DB[str(i)] = "1234567890123456" DB.sync() DB.close() DB1.sync() DB1.close() db.DB().verify(file)