I am getting this exception frequently on console. I have increase Mysql time out period to 8 Hr also but it doesn't work. After restart tomcat it work for some time
again this exceptions come on console.
I am using Tomcat 6 with MySQL, and Torque
[11/21/10 12:02 AM WARNING] TorqueException while getting the new Connection org.apache.torque.TorqueException: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1963)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago. -> com.company.framework.model.util.TorqueUtility.getNewConnection():718
After this exception application stop working and on every click it show this exception on console.
There are a few timeouts you may have to look at. One is the database timeout which you looked at. There's also a transaction timeout set on the application server. And if your database is on the network, you may have a firewall timeout.
A question though - do you have a giant database operation or is this just happening on small operations from time to time? If the later, you should check your connection pool settings. The min size might be too high. Another approach is to try to get the connection a second time on failure.
1. Do you means transaction setting in Tomcat? Where it is ?
2. I am using below setting in "torque.properties". maxWait = 2000.
3. When I got exception I tried to get new connection which also rise same exception means torque it is not allowing to give new connection itself.
4. I think this is not a code level issue. May be I am missing some setting on MySQL/ Tomcat side.
I was thinking you were using a connection pool defined on the Tomcat level. Since you are defining it via Torque, it might not apply. Did you set up a <Resource> in your Tomcat config as described here?
Joined: Nov 26, 2010
By upgrading below
a) dbcp commons library
b) connection pool library
c) mysql j/connector library.