diff --git a/src/cli/clidbman.py b/src/cli/clidbman.py index b222fa678..24dc74462 100644 --- a/src/cli/clidbman.py +++ b/src/cli/clidbman.py @@ -139,8 +139,8 @@ class CLIDbManager(object): from gen.db import META, PERSON_TBL env = db.DBEnv() flags = db.DB_CREATE | db.DB_PRIVATE |\ - db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\ - db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD + db.DB_INIT_MPOOL |\ + db.DB_INIT_LOG | db.DB_INIT_TXN try: env.open(file_name, flags) except: diff --git a/src/gen/db/bsddbtxn.py b/src/gen/db/bsddbtxn.py index 114da01fd..cdf8a4c9e 100644 --- a/src/gen/db/bsddbtxn.py +++ b/src/gen/db/bsddbtxn.py @@ -197,8 +197,8 @@ if __name__ == "__main__": x = db.DBEnv() print "3" x.open('/tmp', db.DB_CREATE | db.DB_PRIVATE |\ - db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\ - db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD) + db.DB_INIT_MPOOL |\ + db.DB_INIT_LOG | db.DB_INIT_TXN) print "4" d = dbshelve.DBShelf(x) print "5" diff --git a/src/gen/db/write.py b/src/gen/db/write.py index 515627f69..9521fcad0 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -452,8 +452,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): # The DB_PRIVATE flag must go if we ever move to multi-user setup env_flags = db.DB_CREATE | db.DB_PRIVATE |\ - db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\ - db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD + db.DB_INIT_MPOOL |\ + db.DB_INIT_LOG | db.DB_INIT_TXN # As opposed to before, we always try recovery on databases env_flags |= db.DB_RECOVER @@ -1073,11 +1073,6 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): self.transaction_abort(self.transaction) self.env.txn_checkpoint() - lockstats = self.env.lock_stat() - _LOG.debug("lock occupancy: %d%%, locked object occupancy: %d%%" % ( - round(lockstats['maxnlocks']*100/lockstats['maxlocks']), - round(lockstats['maxnobjects']*100/lockstats['maxobjects']))) - self.__close_metadata() self.name_group.close() self.surnames.close() @@ -1964,8 +1959,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): # The DB_PRIVATE flag must go if we ever move to multi-user setup env_flags = db.DB_CREATE | db.DB_PRIVATE |\ - db.DB_INIT_MPOOL | db.DB_INIT_LOCK |\ - db.DB_INIT_LOG | db.DB_INIT_TXN | db.DB_THREAD + db.DB_INIT_MPOOL |\ + db.DB_INIT_LOG | db.DB_INIT_TXN # As opposed to before, we always try recovery on databases env_flags |= db.DB_RECOVER diff --git a/src/plugins/tool/MergeCitations.py b/src/plugins/tool/MergeCitations.py index e1ff86732..589eabb39 100644 --- a/src/plugins/tool/MergeCitations.py +++ b/src/plugins/tool/MergeCitations.py @@ -185,8 +185,8 @@ class MergeCitations(tool.BatchTool,ManagedWindow.ManagedWindow): db.disable_signals() num_merges = 0 - with DbTxn(_("Merge Citation"), db) as trans: - for handle in db.iter_source_handles(): + for handle in db.iter_source_handles(): + with DbTxn(_("Merge Citation"), db) as trans: dict = {} citation_handle_list = list(db.find_backlink_handles(handle)) for (class_name, citation_handle) in citation_handle_list: