java - 池连接 tomcat 的 spring boot 中的 minIdle 属性在哪里?

标签 java spring spring-mvc tomcat

我正在尝试在 spring boot 中设置一个连接池,但是我看不到 minIdle 属性: Tomcat description here

((int) The minimum number of established connections that should be kept in the pool at all times. The connection pool can shrink below this number if validation queries fail. Default value is derived from initialSize:10 (also see testWhileIdle) )

Spring 支持不共享有关此属性的任何信息 29.1.2 Connection to a production database .我不知道 Spring Boot 经理是否 自动连接数或属性以其他名称出现。

最佳答案

您应该能够配置其中任何一项 properties在您的 application.properties 中使用此前缀:

spring.datasource.tomcat.min-idle=20

请注意,这里使用的是 kebabcase 而不是驼峰式:

minIdle   -> min-idle
maxActive -> max-active

关于java - 池连接 tomcat 的 spring boot 中的 minIdle 属性在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44590761/

相关文章:

java - Wicket ListView 不刷新

spring - Websphere 应用程序服务器 - Spring MVC - java.lang.NoSuchMethodError : org/codehaus/jackson/map/type/TypeFactory. 类型

spring - Spring tcServer 对 EJB、JAX-WS 的支持

java - 服务器启动时在 Web 应用程序中获取服务器端口

spring - spring MVC POST 表单的大小限制?

java - 使用 spring 更新单个对象并通过 url 发送

java - 将 PHP 代码连接到 Java 后端

java - 如何使用服务帐户从 App Engine 访问 Google 电子表格?

java - JPA注释来保存对象的id