commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Firth <>
Subject RE: [DBCP] post createConnection() initialization.
Date Thu, 15 Aug 2002 10:14:42 GMT

>I'm confused by the confusion on this topic.

>  public interface ObjectPool {
>  public interface PoolableObjectFactory {
>Don't they provide all the hooks you're looking for?  
yes.  but......

>all you need is a delegating instance .... change or extend
>BasicDataSource to not be hard-coded to GenericObjectPool
>and PoolableConnectionFactory
ok, nice idea.  Remembering, however, that the code for BDS' instantiation
of both AbandonedObjectPool & PoolableConnectionFactory instances is
buried quite deeply inside the createDataSource() method - along with
actually instantiating drivers, setting up connection properties etc.  I
still think modifications to the actual *BDS* implementation is best here,
rather than extending it into a new class which would be a nightmare of
copy-n-paste'd code (else a drastic refactoring of
BasicDataSource.createConnection() is needed).

You definately have a point in that modifying AbandonedObjectPool and
PoolableConnectionFactory might not be The Best Idea, but instead
creating two subclasses that are used (primarly) by BDS could be better
since people who use DBCP without BDS would probably extend said
implementations themselves rather than using a listener-style

>The subclass wouldn't necessarily be synchronized just because its
>parent is.
neat.  Didn't think of that advantage.  =)

So, the new idea would be:

* Create a listener interface 
* JNDI resource parameters recognised by BasicDatasourceFactory
* Setters for OnXXXX events in BDS
* Subclasses (rather than delegating instances...) of
AbandonedObjectPool and PoolableConnectionFactory whose constructors now
take one or two instances of the above listener interface as appropriate.

thoughts on take #2?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message