简体   繁体   中英

Spring Boot datasource database connection config doesn't work

Environment:
Java Version: 1.8
Spring Boot Version: 2.0.0.M7

Error Description:
The following are the configuration I set in my application.properties

spring.datasource.tomcat.max-wait=1000  
spring.datasource.tomcat.max-active=2  

But when I ran a load test, the error message showed "Connection is not available, request timed out after 30038ms."

It looks like configuration doesn't work, time out should be around 1000ms

the properties you set are correct, but thefore you have to make sure that JDBC connection is properly recognized from logs of application, cause based on it properties will take affect or not

for example, if you are using mysql, use this SQL command and you will see the process by which will understand was max-active, max-idle applied or not:

SHOW PROCESSLIST;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM