• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database Connection Pool Configuration

 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I use the Tomcat JDBC Connection Pool to connect to an Oracle Database run by an outside organisation. This was working fine until this outside organisation changed their timeout setting to 40 minutes to accommodate another application. Problems occur in the evening when the database has not been accessed for more than 40 minutes - What changes should I make to the configuration settings to prevent the connection being lost?

Many thanks,

Frank
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35269
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank,
What connection pool are you using? Does it allow you to set an in activity timeout/minimal pool size? This would let your connection pool shrink in periods of inactivity (to zero even) and get a connection when there is next activity.

If not, you could write a timer task that runs every 30 minutes. I've never needed to do this though - forcing queries.
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne. I'm using the Tomcat JDBC connection pool, https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html. There is a setting here, setMinIdle, which I imagine can be set to zero. I'll try this and let you know how I get on.

Frank

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35269
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank,
Yes. That's the setting that is equivalent to the one I'm thinking of!
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks Jeanne, your solution worked. I now have a working solution and a better understanding of the configuration.

Frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic