美文网首页
org.springframework.dao.Recovera

org.springframework.dao.Recovera

作者: Audience0 | 来源:发表于2019-02-27 17:17 被阅读0次

    exception:org.springframework.dao.RecoverableDataAccessException:

    Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    The last packet successfully received from the server was 262,050 milliseconds ago. The last packet sent successfully to the server was 262,053 milliseconds ago.

    本次 是因为获取数据库连接的时候获取到无效的连接导致该异常。
    解决方式:
    设置数据源该属性
    <property name="validationQuery" value="SELECT 1"/>
    <property name="testOnBorrow" value="true"/>

    image.png

    相关文章

      网友评论

          本文标题:org.springframework.dao.Recovera

          本文链接:https://www.haomeiwen.com/subject/pzsxuqtx.html