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

AsyncBatchCursor when batchSize is 1 terminates prematurely

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.4.2
    • API, Async

    Description

      It appears that when using the async Java driver, if you create an AsyncBatchCursor via

      cursor = collection.find(bson).batchSize(1).batchCursor(callback)
      

      specifically using batchSize = 1, the cursor closes after a single call to next(), even when there are multiple elements to return. i.e. the second call to next() results in null. This behaviour is consistent. Changing the batchSize to > 1 resolves the problem.

      I'd be grateful if somebody can confirm they can reproduce this. This looks like something really simple to have been overlooked in testing, so I want to ensure I'm not going nuts!

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            lJoublanc Luciano Joublanc [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: