We are facing below two issues.
- Unable to get managed connections for java:jboss/datasources/testDS
- com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed by the driver ........
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 58,888,102 milliseconds ago. The last packet sent successfully to the server was 58,888,103 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.
We use JBoss EAP 6.0.
Standalone xml configuration is given below
For the first issue,
from my understanding following may be the root cause
- Some connections are not closed properly and there are no more connections available
- Max connection of 20 is not enough to handle the load, increasing the max pool size may help
Is there any other reasons?
How to fix this apart from closing all connections if any?
Do we need to add <idle-timeout-minutes> and <
For the second issue,
We observed this occurs when we leave the application idle for say 8-10 hours and accessing it next day.
From JBoss forum I read we need to add validation settings also.
The default wait_timeout in MySQL is 8 hours. If we specify <idle-timeout-minutes> of say 30 minutes, whether this will override MySQL wait timeout?
And whether this will resolve this issue?
Or do we need to add the validation settings, like
background-validation and <background-validation-millis> ?