Default connection pool for tomcat in spring-boot?

28,116

Solution 1

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

Solution 2

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

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

Share:
28,116
membersound
Author by

membersound

JEE + Frameworks like Spring, Hibernate, JSF, GWT, Vaadin, SOAP, REST.

Updated on September 16, 2020

Comments

  • membersound
    membersound over 3 years

    What is the default value used for maximum connections on a postgres database with tomcat connection pooling using spring-boot?

    There is a property spring.datasource.maxActive, but when I try to sysout it, I'm getting 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}