1 Reply Latest reply: May 7, 2012 9:17 AM by Greybird-Oracle RSS

    Pagination on SecondaryDB, possible?

    user8997135
      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?
          Greybird-Oracle
          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.

          --mark