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

FindIterable.map().first() does not seem to close the underlying cursor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.7.1
    • Fix Version/s: 3.8.0
    • Component/s: Query Operations
    • Labels:
      None

      Description

      With the current MappingIterable.first() implementation:

       

      @Nullable@Overridepublic V first() {
      MongoCursor<V> iterator = iterator();
      if (!iterator.hasNext()) {
      return null;
      }
      return iterator.next();
      }

       

      It seems that the MongoCursor.close() method is not called on a col.find().map().first() call.

      HTH

        Attachments

          Activity

            People

            Assignee:
            ross.lawley Ross Lawley
            Reporter:
            jburet Julien Buret
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: