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

Sergio-Oracle

$ sudo python -m pip install --upgrade pip

Collecting pip

  Downloading https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl (1.4MB)

    100% |████████████████████████████████| 1.4MB 700kB/s

Installing collected packages: pip

  Found existing installation: pip 8.1.2

    Uninstalling pip-8.1.2:

      Successfully uninstalled pip-8.1.2

Successfully installed pip-19.2.3

[opc@ow ~]$ sudo python -m pip --version

pip 19.2.3 from /usr/lib/python2.7/site-packages/pip (python 2.7)

1 - 1
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,572 views