spring boot下mybatis遇到No operations allowed after connection closed.

在配置文件中添加

# for initial,min,max
spring.datasource.initialSize=5
spring.datasource.minIdle=5
spring.datasource.maxActive=100
# sql for validating
spring.datasource.validationQuery=SELECT 1
# this will validate idle connection.if validation failed, will remove from pool
spring.datasource.testWhileIdle=true
spring.datasource.testOnBorrow=false
spring.datasource.testOnReturn=false
# max wait time
spring.datasource.maxWait=60000
spring.datasource.timeBetweenEvictionRunsMillis=30000

转载于:https://www.cnblogs.com/taojintianxia/p/7327680.html

你可能感兴趣的:(spring boot下mybatis遇到No operations allowed after connection closed.)