You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Roytman, Alex" <Ro...@peacetech.com> on 2002/11/07 21:36:44 UTC

[dbcp] Jdbc2PoolDataSource Proposal

Attached pleas find proposed Jdbc2PoolDataSource rework.

I tried to address some issues I mentioned in this email

http://www.mail-archive.com/commons-dev@jakarta.apache.org/msg11459.html

Jdbc2PoolDatasource allows eviction of idle connections. It is done either via shareable TimerService or per datasource daemon thread. Threads are expensive given large number of datasources. Shareable TimerService is preferred. If you specify timerServiceName factory parameter pool will use this timer service for eviction otherwise it will use daemon thread provided by commons-pool pools TimerServiceImpl is based on java.util.Timer found in JDK 1.3.x and later 

Sample configuration of timer service is in tomcat/conf/server.xml (see timer/GlobalEvictionTimer resource) and tomcat context with JDBC data sources is  tomcat/webapps/webtools.xml 

It in beta state and not all features have been implemented (like validation on check-in/check-out which is not very much needed for jdbc2 pooled connection I think) but it seems to be pretty stable. I did some pretty heavy stress testing trying to randomly kill connections on server side while testing to make sure these bad connections do not get stuck in the pool. 

I would be glad to donate this files to jakarta-commons if there is any interest.

Please let me know what you think

Alex