From 177a7782aee4c4789ad5377b5993bfa0b692282e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 31 Jul 2003 14:28:49 +0000 Subject: [PATCH] * Use a more reasonable log file size (256 KB instead of 10 MB). * Checkpoint on exit. --- src/db.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/db.cc b/src/db.cc index 4362fe4055..77ad93a86d 100644 --- a/src/db.cc +++ b/src/db.cc @@ -94,6 +94,8 @@ Database::Database() Database::~Database() { if (env) { + debug(format("closing database environment")); + env->txn_checkpoint(0, 0, 0); env->close(0); delete env; } @@ -108,12 +110,14 @@ void Database::open(const string & path) env = new DbEnv(0); - debug("foo" + path); + env->set_lg_bsize(32 * 1024); /* default */ + env->set_lg_max(256 * 1024); /* must be > 4 * lg_bsize */ + env->open(path.c_str(), DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_CREATE, 0666); - + } catch (DbException e) { rethrow(e); } }