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

MongoClientOptions.maxConnectionIdleTime and maxConnectionLifeTime can accept 0 values

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.5.0
    • Affects Version/s: None
    • Component/s: Documentation
    • None

      The setters MongoClientOptions.maxConnectionIdleTime and MongoClientOptions.maxConnectionLifeTime accept any Integer values, while the Javadoc clearly says:

      /**
       * Sets the maximum life time for a pooled connection.
       *
       * @param maxConnectionLifeTime the maximum life time, in milliseconds, which must be > 0
       * @return {@code this}
       * @throws IllegalArgumentException if {@code maxConnectionLifeTime <= 0}
       * @see com.mongodb.MongoClientOptions#getMaxConnectionIdleTime()
       * @since 2.12
       */
      

      Either the javadoc is wrong, or the driver is wrong.

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            yonatang Yonatan Graber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: