[JAVA-2481] MongoClientOptions.maxConnectionIdleTime and maxConnectionLifeTime can accept 0 values Created: 02/Apr/17  Updated: 03/Apr/17  Resolved: 03/Apr/17

Status: Closed
Project: Java Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: 3.5.0

Type: Bug Priority: Trivial - P5
Reporter: Yonatan Graber Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.



 Comments   
Comment by Ross Lawley [ 03/Apr/17 ]

Thanks yonatang,

It should read >=0, the same as documented in MongoClientOptions#getMaxConnectionIdleTime.

Ross

Comment by Githook User [ 03/Apr/17 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Docs: Fix API docs in MongoClientOptions.Builder

Updated maxConnectionIdleTime and maxConnectionLifeTime.

JAVA-2481
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/3ccf6de18a0eebc56dc0a6dd83b3375fc5e79db5

Generated at Thu Feb 08 08:57:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.