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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

Manish Kapur-Oracle

Hi Dhruval,

You are using an old tutorial. Refer to the docs and video below. Creating storage containers can now be done via UI and is very easy.

Before You Begin with Oracle Java Cloud Service

https://youtu.be/lN8kwYEedIg

Be sure you also select a Replication Policy before you create your first storage container. See Selecting a Replication Policy for Oracle Storage Cloud Service in Using Oracle Storage Cloud Service. Hope it helps!

DilipG

Hi,

Please refer below scripts and add your credential details in script accordingly.

Syntax:

curl -v -s -X PUT -H "X-Auth-Token: AUTH_tk85388cfc91ece053145e3ff386e96552" https://storage.us2.oraclecloud.com/v1/Storage-myIdentityDomain/myFirstContainer

Script:

curl -v -s -X PUT -H "X-Auth-Token:  AUTH_tk85388cfc91ece053145e3ff386e96552"   https://storage.us2.oraclecloud.com/v1/Storage-dgcloud/myFirstContainer

Regards,

Dilip

SanjeevChauhan

By 403 it seems like your token is expired. You can generate new x-auth-token token and then try.

If your only aim is to create a directory, you can use cloudberry to work with cloud storage.

Technology Blog: Oracle Cloud: Using Cloud Berry to connect with Cloud Storage

Thanks

Sanjeev

1 - 3
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,564 views