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!

Concurrent Data Storage Example

535773Sep 25 2006 — edited Sep 25 2006
Is there handy example on how to use Concurrent Data Storage?

I am witing an sample program, in which a process spawns a thread and writes to HashMap every 10 secs, and on other side multiple processes with multple threads which constantly reads the HashMap every 10 secs.

I was successful, in writing sample progams for writing and reading those HashMaps. But, on reading the HashMap, I don't get updated data. I have restart the reader process to read most current data.

On Writer, I am setting these flags:

envConfig.setTransactional(false);
envConfig.setLocking(false);
envConfig.setAllowCreate(true);

dbConfig.setTransactional(false);
dbConfig.setAllowCreate(true);

Also, I am calling env.sync(), after I do map.put(index, value) on HashMap.

On Reader, I am setting these flags:

envConfig.setTransactional(false);
envConfig.setLocking(false);
envConfig.setReadOnly(true);
dbConfig.setTransactional(false);
dbConfig.setReadOnly(true);

And I am calling map.get(index) to retrieve the value.

Do, I have to set any other flags? Or I am totally off the course.

Thanks

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 23 2006
Added on Sep 25 2006
9 comments
1,569 views