1 Reply Latest reply on May 7, 2012 2:17 PM by Greybird-Oracle

    Pagination on SecondaryDB, possible?

      I found the following on the forum.

      The best way to do paging with BDB JE is to save the key of the first and last items on the current page. When you need to go to the next or previous page, start at the appropriate key and read forward or backward.

      But SecondaryDB has same keys if I'm not mistaken. Then how to do it? Can I save the cursor for later use?
        • 1. Re: Pagination on SecondaryDB, possible?
          Keeping the cursor open will hold a lock, and undoubtedly cause deadlocks with other threads.

          For a duplicates DB (normally a secondary DB), you can save the key and data at the cursor position, and restore that position later using Cursor.getSearchBothRange.