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!

Blocked getSearchKey cursor skips duplicate records when unblocked

3650087Feb 21 2018

Implementation-Title: Berkeley DB Java Edition

Implementation-Version: 7.5.12

Implementation-Vendor: Oracle

Implementation-URL: http://www.oracle.com/

Build-Date: 2017-12-18 11:39:44 UTC

In a transactional, non-replicated database that allows duplicates, I see the following behavior:

There is a single record with key="Duplicated" and value="2" in the database.

The cursor in transaction A locks the record with getSearchKey() with key="Duplicated" and LockMode.RMW.

A different cursor in transaction B does the same search and must wait on the lock.

1. If I put a record with key="Duplicated" and value="1" with transaction A and commit, the transaction B search will acquire the lock and see the data of the record with value="2". After that, calls to getNextDup() will not find the record with value="1".

2. If I put a record with key="Duplicated" and value="1" and delete the record with key="Duplicated" and value="2" with transaction A and commit, the transaction B search will return OperationStatus.NOTFOUND.

Question:

Is there a way for transaction A to acquire a lock for all of key="Duplicated" and LockMode.RMW such that transaction B will efficiently see all of the data for key="Duplicated"?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2018
Added on Feb 21 2018
0 comments
289 views