commons-dev mailing list archives

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

>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
interface.

>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?


matthew


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message