Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1091

Always set awaitData along with tailable

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.12.0, 3.0.0
    • None
    • Query Operations
    • None

    Description

      DBCursor#addOption allows a user to set the option Bytes.QUERYOPTION_TAILABLE. There are no circumstances where a user would not want to also set Bytes.QUERYOPTION_AWAITDATA, so if the former is set, the latter will now also be set.

      As part of this change, there will be a behavioral change to DBCursor#hasNext(). It used to be that if tailable was set but not awaitData, hasNext() could return false on one invocation, followed by true on the next. This really violates the contract of Iterator, so the driver will no longer allow it. DBCursor#hasNext will now block until either a new document is available or the cursor is no longer valid.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: