Could you provide the full stack trace? And if possible, can you describe time it takes as it relates to the timeout of your MySQL server? The default timeout in MySQL is 8 hours, but is configurable. Also I'm assuming all the ${...} stuff is just you sanitizing the <Resource ... /> block. One last question ... is there any chance your code is holding on to connections as opposed to closing them when done? Closing from the app's point of view is just returning the connection to the pool for another request later.
--David Chetouani wrote: > Hello guys, > > If you can help with this problem. > > I have an application deployed on tomcat V6.18. It uses a mysql database. > The problem is that after some hours the applicatiion throws an exception > when trying to connect to the data base. > > com.mysql.jdbc.CommunicationsException: Communications link failure due to > underlying exception > > I cofigured a data source using dbcp : > > <Resource name="jdbc/${database.datasource}" > auth="Container" > type="javax.sql.DataSource" > factory="org.apache.commons.dbcp.BasicDataSourceFactory" > driverClassName="${database.driver}" > url="${database.url}" > username="${database.user}" > password="${database.password}" > removeAbandoned="true" > removeAbandonedTimeout="300" > logAbandoned="true" > maxActive="20" > maxIdle="20" > maxWait="10000" > validationQuery="SELECT 1" > testOnBorrow="true" > testOnReturn="true" > testWhileIdle="true"/> > > I did some searches and it seems that the problem is that the connection pool > keeps the connections for a long time even if they are considered dead by > mysql > > So if you can help > > Thanks > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org