commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Waldhoff, Rodney" <>
Subject RE: [VOTE] [pool] Pool 1.0 Release
Date Tue, 07 May 2002 12:09:44 GMT
(A friendly reminder: Pool != DBCP)

> 1) I am having a problem using 
> public StackObjectPool(PoolableObjectFactory factory, 
> int max, int init) in a  JOCL(DBCP) file.  found that 
> there were no instantiable Factories which 
> implement PoolableObjectFactory(param 1). 
> We have BasePoolableObjectFactory 
> though, which is an abstract class. 

Use org.apache.commons.dbcp.PoolableConnectionFactory. This takes a
ConnectionFactory, for which there are three implementations in DBCP:

* DataSourceConnectionFactory
* DriverConnectionFactory
* DriverManagerConnectionFactory

There's actually an example of this at
(poolingDriverExample.jocl.sample in the docs directory)  It should be
straightforward to adapt that example to other connection-factories or types
of pools.

> Is it expected that users create their own 
> factories for "StackObjectPool". But surprisingly, I 
> found that StackObjectPoolFactory says 
> that "A factory for creating {@link StackObjectPool} 
> instances." but this factory does not 
> implement PoolableObjectFactory 
> (instead implements ObjectPoolFactory). 

PoolableObjectFactory creates objects used by a pool. This is used by a pool
to create and destroy poolable objects.  Several implementations already
exist.  See above.

ObjectPoolFactory creates pools. This is used (probably exclusively) by DBCP
in order to create new pools of PreparedStatements as needed.  You probably
don't need to worry about these for now, but there are factories for
StackObjectPool and GenericObjectPool in the pool package.

> I would appreciate help rearding this matter. 

Hope that helps.

> Is there a way for the "pool to be 
> pre-populated" 
> in DBCP using JOCL files ? 

No, not currently.

> 2) Also , some references in the javadoc 
> for the constructors of "StackObjectPool" 
> mention "SimpleObjectPool" instead of 
> "StackObjectPool". 

Good catch, thanks.

> Thank you for any suggestions, 
> Best Regards, 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message