Skip to content

Commit

Permalink
Validate maxLifetime & idleTimeout and document their zero values.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdubb committed Apr 5, 2023
1 parent 51e6760 commit 1d81787
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,13 @@ public int getIdleTimeout() {
}

/**
* Establish an idle timeout for pooled connections.
* Establish an idle timeout for pooled connections, a value of zero disables the idle timeout.
*
* @param idleTimeout the pool connection idle timeout
* @return a reference to this, so the API can be used fluently
*/
public PoolOptions setIdleTimeout(int idleTimeout) {
Arguments.require(idleTimeout >= 0, "idleTimeout must be >= 0");
this.idleTimeout = idleTimeout;
return this;
}
Expand Down Expand Up @@ -224,12 +225,13 @@ public int getMaxLifetime() {
}

/**
* Establish a max lifetime for pooled connections.
* Establish a max lifetime for pooled connections, a value of zero disables the maximum lifetime.
*
* @param maxLifetime the pool connection max lifetime
* @return a reference to this, so the API can be used fluently
*/
public PoolOptions setMaxLifetime(int maxLifetime) {
Arguments.require(maxLifetime >= 0, "maxLifetime must be >= 0");
this.maxLifetime = maxLifetime;
return this;
}
Expand Down

0 comments on commit 1d81787

Please sign in to comment.