Default connection pool for tomcat in spring-boot?

What is the default value for maximum connections in a postgres database with tomcat connection pool using spring-boot ?

There is a spring.datasource.maxActive property, but when I try to sysout it, I get an exception:

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

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

+5
source share
2 answers

According to org.apache.tomcat.jdbc.pool.PoolProperties , the default value is 100

+6
source

You need to set spring.datasource.max-active in your application.properties or application.yaml to get the value in the bean class

Refer https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html for regular .properties applications

+1
source

Source: https://habr.com/ru/post/1243203/


All Articles