-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
Description
MySQL close idle connections after 8 hours. I have 2 questions regarding this.
- With the nonBlocking pool, if I specify healthCheck and idleTimeBeforeHealthCheck, does it mean it will keep the connections alive? for example
Pools.nonBlocking()
.connectionProvider(ConnectionProvider.from(url, username, password))
.healthCheck(DatabaseType.MYSQL)
.idleTimeBeforeHealthCheck(5, TimeUnit.SECONDS)
.build();
- If I use the blocking pool and pass spring boot auto configured dataSource, will it keep the connection alive? for example:
@Configuration
public class DataSourceConfig {
@Bean
public Database db(DataSource ds){
return Database.fromBlocking(ds);
}
}
in application.properties
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://...
spring.datasource.username=username
spring.datasource.password=password