同事遇到个报错如下:
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
The last packet successfully received from the server was 10,036 milliseconds ago. The last packet sent successfully to the server was 10,036 milliseconds ago.
业务场景为流程审核通过后需修改业务表的状态值,先执行流程表,再执行业务表。打断点发现执行流程那块比较耗时,流程表flow_task 主键id和业务表主键id值一样,尝试把业务表那块代码休眠,然后2张表都成功执行。问题是解决了,但大概需要耗时较长,用户体验不会很好。
TimeUnit.MINUTES.sleep(1);