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

Some DBCursor array methods may not close underlying cursor

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

      It appears that 4 methods exposed on DBCursor have the potential to not have the underlying cursor closed in the event of an IO error.

      • itcount()
      • length()
      • toArray()
      • toArray(int)

      Note that exhausting a cursor causes the server-side cursor to be closed. Therefore on the one hand, 3 out of 4 methods above are fine on the happy path, and are only exposed in the case of an IO error. However toArray(int) is more risky, since in this case the cursor may not be exhausted, either, depending on the int argument value and length of the result set.

            Assignee:
            john.morales@mongodb.com John Morales (Inactive)
            Reporter:
            john.morales@mongodb.com John Morales (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: