Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

setTnxNoSync: No disk access before a sync

828433Jan 5 2011 — edited Jan 13 2011
Hello,

I try to use Berkeley DB to store a lot of KV.The software must index a lot of data (put/get) and then wait for resquest from user (get) or new information for the index (put/get).
During the big indexing phase, It should be great if Berkeley DB add all data in memory (with cache) and write it manually on disk (with a sync()) from time to time.
So I was looking for a "setDeferredWrite" method like in Berkley DB Java Edition.
I found this post: 6504264
So I try to do "EnvironmentConfig.setTxnNoSync(true)" with:

envConfig_ = new EnvironmentConfig();
envConfig_.setAllowCreate(true);
envConfig_.setInitializeCache(true);
envConfig_.setTransactional(false);
envConfig_.setTxnNoSync(true);

But I get an error message for an invalid argument:

+ incompatible with existing environment+
createEnv: java.lang.IllegalArgumentException: Invalid argument
java.lang.IllegalArgumentException: Invalid argument
at com.sleepycat.db.internal.db_javaJNI.DbEnv_open(Native Method)
at com.sleepycat.db.internal.DbEnv.open(DbEnv.java:248)
at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:830)
at com.sleepycat.db.Environment.<init>(Environment.java:30)
at person.Env.createEnv(Env.java:67)
at person.Main.main(Main.java:25)

1. Are there other config information to change?
2. With setCachesize and setTxnNoSync, BDB will put everything in cache memory (if enough) without writing on disk? Are there other fields to change to add a lot of data during big indexing phase very quickly?

Thanks a lot
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2011
Added on Jan 5 2011
3 comments
143 views