davidmoten / davidmoten/rxjava2-jdbc

MySQL connection 8 hours timeout issue

Open
#43 5 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
394
Forks
41
Avg merge
2m
Merged PRs (30d)
1

Description

MySQL close idle connections after 8 hours. I have 2 questions regarding this.
1. 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();
```
2. 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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.