简体   繁体   English

Spring Boot数据源数据库连接配置不起作用

[英]Spring Boot datasource database connection config doesn't work

Environment: 环境:
Java Version: 1.8 Java版本:1.8
Spring Boot Version: 2.0.0.M7 春季启动版本:2.0.0.M7

Error Description: 错误说明:
The following are the configuration I set in my application.properties 以下是我在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." 但是,当我运行负载测试时,错误消息显示“连接不可用,请求在30038ms后超时”。

It looks like configuration doesn't work, time out should be around 1000ms 看来配置无效,超时应该在1000毫秒左右

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 您设置的属性是正确的,但是在此之前,您必须确保从应用程序日志中正确识别了JDBC连接,基于该属性的原因将影响或不影响

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: 例如,如果您使用的是mysql,请使用以下SQL命令,您将看到了解是否应用了max-active,max-idle的过程:

SHOW PROCESSLIST;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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