perl, BerkeleyDB and CDS mode
Is there an example of using CDS mode for BerkeleyDB with perl on a Debian system? I am initializing with:
$db_e开发者_JAVA技巧nv = new BerkeleyDB::Env
-Home => "/tmp",
-Flags => DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL
or die "cannot open environment $BerkeleyDB::Error";
And I am getting an "invalid argument" error for DB_INIT_MPOOL. If I omit it, I get complaints about "environment did not include a memory pool" (for either Hash or Btree databases).
Simple answer to this is to remove the files __db.XXX, where XXX is three numbers. For example in my environment I had three files, __db.001, __db.002 and __db.003.
I know this is an old post and the previous answer essentially is the same thing but the example would have helped me when I stumbled over this post while googling yesterday.
And I am getting an "invalid argument" error for DB_INIT_MPOOL. If I omit it, I get complaints about "environment did not include a memory pool" (for either Hash or Btree databases).
You're typically getting this first kind of error ("Invalid argument") if you try to create an environment where an environment with a different configuration (different flags) already exists.
As for the second error (missing memory pool), it's because you're instructing BDB to do DB_INIT_CDB
without DB_INIT_MPOOL
- that's not possible, CDB has to go with a memory pool.
Take a look at this other BDB/CDB question, I've left some pointers to documentation there that might prove interesting to you.
精彩评论