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

MongoCursor implementations should throw if iterated after close

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Won't Fix
    • None
    • None
    • Query Operations
    • None

    Description

      Currently, MongoCursor implementations may return results even after they have been closed, because they are relying on the underlying BatchCursor to throw an exception, even though it's still possible to return results from the current batch, e.g.

      var cursor = collection.find().cursor();
      cursor.next();
      cursor.close();
      cursor.next();   // should throw, but does not if the first batch has > 1 results
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: