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

MongoCursor implementations should throw if iterated after close

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Query Operations
    • Labels:
      None

      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
      

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

              Created:
              Updated:
              Resolved: