summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-31 14:28:49 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-31 14:28:49 +0000
commit177a7782aee4c4789ad5377b5993bfa0b692282e (patch)
treed380af8a637ff3e276b5f8287c485bb07ef80dac
parent4a013962bdd08ee0cf285136e4eca0f2c9c76b98 (diff)
downloadguix-177a7782aee4c4789ad5377b5993bfa0b692282e.tar.gz
* Use a more reasonable log file size (256 KB instead of 10 MB).
* Checkpoint on exit.

-rw-r--r--src/db.cc8
1 files 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); }
 }