I read this advice from error message:
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'm using Spring and JPA. Where should I configure Connector/J? (in persistence.xml
, or in entityManagerFactory
spring configuration, or in dateSource
spring configuration, or somewhere else?)