[ 
https://issues.apache.org/jira/browse/ROL-2175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17564718#comment-17564718
 ] 

David M. Johnson commented on ROL-2175:
---------------------------------------

Hi [~cml] , thanks for pointing this out. I see reference to a validationQuery 
in the Tomcat docs ([https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html)] 
and it looks like something that needs to be added to the Tomcat configuration 
for Roller. 

The Roller install guide discusses using a <Context> configuration file with a 
<Resource> for the Roller database connection and that is where the 
valudationQuery would go:

https://github.com/apache/roller/blob/roller-6.0.x/docs/roller-install-guide.adoc#62-using-server-provided-database--mail-resources-optional

> mysql connection errors due to no validation
> --------------------------------------------
>
>                 Key: ROL-2175
>                 URL: https://issues.apache.org/jira/browse/ROL-2175
>             Project: Apache Roller
>          Issue Type: Bug
>            Reporter: Chris Lambertus
>            Priority: Major
>
> Pursuant to INFRA-22461, despite having autoReconnect=true in our JDBC URI, 
> we still see these failures constantly:
> DatabaseException
> Internal Exception: com.mysql.cj.jdbc.exceptions.CommunicationsException: The 
> last packet successfully received from the server was 85,486,668 milliseconds 
> ago. The last packet sent successfully to the server was 85,486,674 
> 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.
> Error Code: 0
>  
> Most java applications using the default Tomcat JDBC Resource allow for a 
> validationQuery parameter such as "SELECT 1" to keep the database connection 
> alive. Can such a parameter be added to roller to avoid database timeouts?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to