0 Replies Latest reply on Feb 21, 2018 9:22 PM by 3650087

    Blocked getSearchKey cursor skips duplicate records when unblocked

    3650087

      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"?