Synchronizing database connections (pooling in Tomcat)

My dB connections keep failing. I have looked at some of the solutions people have suggested to this and have implemented them, but nothing has worked out so far. Any new thoughts will be very helpful.

Problem
For some webapp requests, this is the error I get:

com.mysql.jdbc.CommunicationsException: The last packet successfully received from the server was 11,198,881 million ago. The last packet successfully sent to the server was 11,198,881 milliseconds ago. greater than the server-specified "wait_timeout" value. You should consider expiring and / or checking the validity of the connection before using it in your application, increasing the server setting of the value for client timeouts, or using the Connection Connector / J property 'autoReconnect = true' to avoid this issue.

Solutions tried

  • Checking the reliability of the connection
  • Using autoReconnect

Context.xml content

Resource name = "jdbc / dBConnectionMain" auth = "Container" type = "javax.sql.DataSource" maxActive = "20" maxIdle = "18" removeAbandoned = "true" removeAbandonedTimeout = "60" logAbandoned = "true" validationQuery = " select 1 "testOnBorrow =" true "username =" user "password =" password "driverClassName =" com.mysql.jdbc.Driver "url =" jdbc: mysql: // localhost / databaseName? autoReconnect = true "/

Any pointers to this?

Cheers,
RD

+2
tomcat connection pooling


source to share


No one has answered this question yet

See similar questions:

3
Tomcat-Mysql connections in connection pool after idle timeout

or similar:

13
Java + Tomcat Dying Database Connection?
3
JDBC connection timed out cannot reconnect
2
JDBC connection: not reconnecting after timeout
1
Tomcat issue: The last packet successfully received from the server was 66,913,221 million seconds ago.
1
Tomcat context defined in server.xml not loading
0
How do I configure Hibernate to use DBCP2 connection pooling?
0
Tomcat connection pool: java.sql.SQLRecoverableException: No more data to read from socket
0
Java Hibernate database connection timed out after a few minutes
0
Error while merging JNDI connections
-1
I am moving my application web logic to Tomcat7



All Articles
Loading...
X
Show
Funny
Dev
Pics