Data AccessCore JavaApp FrameworksViewTestingBuildingDeploymentDev ToolsSecurityOpinions

Sunday, October 18, 2009

Tomcat DBCP DataSource falls idle overnight

If you have a low activity web server using Tomcat DBCP to retrieve connections to your database, the database server might time out connections in the pool.

Adding the following to your <Resource> configuration can address the problem.
  • testOnBorrow="true"
  • validationQuery="SELECT 1 /* ping */"

3 comments:

  1. be carefull, "SELECT 1" doesn't work everywhere, for example mysql do, but postresql don't ^^

    ReplyDelete
  2. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai

    ReplyDelete