• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pool: connecting in memory

 
Haroldo Nascimento
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I would like know if manager DB pool create a number of connection in memory to better the performance or the manager DB pool create connection on-demand only.

Other doubt is if the manager pooling connecting have mechanism of verify is the connectiong is "alive" for example executing any query select in the DB to verify the status of connecting ?

thanks
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to both questions is : "depends on the pool".

Since you're asking in the Apache/Tomcat forum, I'll talk about Jakarta's Database Connection Pool (DBCP).

1) the pool instantiates connections 'as needed' up to the configured maximum number of connections.

2) you can configure DBCP to do a verification query (for example, "SELECT 1").

All the settings for DBCP are documented here:
http://jakarta.apache.org/commons/dbcp/configuration.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic