ERRO DE CONEXÃO COM JPA MYSQL

02/05/2016

0

Boa tarde Diego!

Tenho um sistema que já está em produção, onde utilizo as tecnologias, JSF Primefaces, Hibernate 5.0 com JPA e como o banco de dados utilizo o MySql 6.3 CE. Ocorre que quando em produção ocorreu o seguinte erro no mysql
 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was36940 seconds ago.The last packet sent successfully to the server was 36940 seconds ago, which 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. 


Depois de dado este problema, tenho que reiniciar o Tomcat para o sistema funcionar. Como resolver esse problema.
Girleno Silva

Girleno Silva

Responder

Posts

02/05/2016

Marcos Paulo

Reiniciar sempre o tomcat? com que frequencia?
Responder

02/05/2016

Girleno Silva

É um erro de timeout no MySQL. Conforme erro abaixo. Não quero ter que reiniciar toda vez o tomcat quando esse erro ocorrer.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was36940 seconds ago.The last packet sent successfully to the server was 36940 seconds ago, which 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.


Este erro ocorre com o MySQL depois de mais ou menos oito horas de funcionamento da aplicação e a mesma é travada. Como corrigir esse problema?
Responder

02/05/2016

Marcos Paulo

O arquivo de conexão, está ok?
Responder

APRENDA A PROGRAMAR DO ZERO AO PROFISSIONAL

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar