Can any MySQL users give me some advice on Datasou...
# lucee
g
Can any MySQL users give me some advice on Datasource connection settings? I am seeing a lot of error messages:
Copy code
Caused by: org.hibernate.TransactionException: JDBC commit failed
        ... 53 more
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 389,215 milliseconds ago. The last packet sent successfully to the server was 389,215 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.
Previously I did a lot of research / googling and found that the people that had "fixed" the issue were stating that they manually reset the connection pool every 6 hours. (I don't exactly remember but it was something about the (DB?) default connection timeout) And ultimately started running a scheduled task every 6 hours (5h 55m) that calls dbPoolClear(). It "seemed" to work - but the messages are back. At the same time as implementing the scheduled task, I also changed the timeouts in the Lucee / Datasource settings to; Connection limit (max): 100 Connection idle timeout (in minutes) : 5 Connection timeout : 15 I thought, all the above fixed my problem - but I am seeing the "The last packet successfully received from the server was XXX milliseconds" again and thought I better ask, again for some help / recommendations. • Is there was anything I had misconfigured (above) • Is there some other Datasource setting I should check / change? • Any non Datasource setting changes I should check / complete.
c
Have you tried adding
autoReconnect=true
to the datasource connection string?
g
Nope. But I certainly can. I "thought" that during my initial investigation I thought that using this option was a bad idea?