I have a nice little Spring Boot JPA web application. It is deployed on Amazon Beanstalk and uses an Amazon RDS for persisting data. It is however not used that often and therefore fails after a while with this kind of exception:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 79,870,633 milliseconds ago.
The last packet sent successfully to the server was 79,870,634 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
I am not sure how to configure this setting and can not find information on it on http://spring.io (a very good site though). What are some ideas or pointers to information?
DataSource
and verify its properties. https://mcmap.net/q/175927/-spring-boot-jdbc-hsqldb-how-to-verify-if-spring-boot-is-using-a-connection-pool Spring Boot will not auto-configure theDataSource
if you have any@Beans
which define aDataSource
. docs.spring.io/spring-boot/docs/1.5.16.RELEASE/reference/… – Fungi