mysql版本:5.7
解决mybatis框架自带连接池的JDBC连接过期失效导致的问题
部分异常信息:
The last packet sent successfully to the server was 53,526,566 milliseconds ago.
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/test"/>
<property name="username" value="root"/>
<property name="password" value="123"/>
<!-- 每隔1小时检查一下连接是否还有效 -->
<property name="poolPingEnabled" value="true"/>
<property name="poolPingQuery" value="select 1"/>
<property name="poolPingConnectionsNotUsedFor" value="3600000"/>
</dataSource>
</environment>