【问题标题】:Default connection pool for tomcat in spring-boot?spring-boot中tomcat的默认连接池?
【发布时间】:2016-05-28 21:25:15
【问题描述】:

使用tomcat 连接池使用spring-bootpostgres 数据库上的最大连接数的默认值是多少?

有一个属性spring.datasource.maxActive,但是当我尝试对其进行系统输出时,我遇到了一个异常:

@Value("${spring.datasource.maxActive}")
private String act;

java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.maxActive' in string value "${spring.datasource.maxActive}

【问题讨论】:

  • 安装执行器并检查那里的值

标签: java spring postgresql tomcat spring-boot


【解决方案1】:

根据org.apache.tomcat.jdbc.pool.PoolProperties默认值为100

【讨论】:

    【解决方案2】:

    您需要在 application.properties 或 application.yaml 中设置 spring.datasource.max-active 以获取 bean 类中的值

    常见的application.properties参考https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-07
      • 2015-03-18
      • 2019-12-16
      • 1970-01-01
      • 2019-08-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多