提交 046bca7e authored 作者: Thomas Mueller's avatar Thomas Mueller

JdbcConnectionPool: it was possible to set a negative connection pool size.

上级 ba0f6753
...@@ -99,8 +99,8 @@ public class JdbcConnectionPool implements DataSource { ...@@ -99,8 +99,8 @@ public class JdbcConnectionPool implements DataSource {
* @param max the maximum number of connections * @param max the maximum number of connections
*/ */
public synchronized void setMaxConnections(int max) { public synchronized void setMaxConnections(int max) {
if (maxConnections < 1) { if (max < 1) {
throw new IllegalArgumentException("Invalid maxConnections value."); throw new IllegalArgumentException("Invalid maxConnections value: " + max);
} }
this.maxConnections = max; this.maxConnections = max;
// notify waiting threads if the value was increased // notify waiting threads if the value was increased
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论