broken because of SQLSTATE(08S01), ErrorCode(0)
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet successfully received from the server was 5,078,468 milliseconds ago. The last packet sent successfully to the server was 5,078,479 milliseconds ago.
程序用一段时间就挂掉了,一开始以为是配置的问题,后来发现自己在使用 EntityManager 这个类出的问题
将@Resoure 改成 @PersistenceContext 注解
代码就可以持续跑动