Hi,

I tried to follow this example
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/PoolingDataSourceExample.java?view=markup

but at lines 148/149
148 PoolableConnectionFactory poolableConnectionFactory =
149         new PoolableConnectionFactory(connectionFactory);

it fails because, according to http://commons.apache.org/dbcp/api-1.4/index.html <http://commons.apache.org/dbcp/api-1.4/index.html>, all constructors need an ObjectPool
but also all costructors of GenericObjectPool need a PoolableObjectFactory!

I "solved" the problem by this work-around
PoolableConnectionFactory poolableConnectionFactory =
new PoolableConnectionFactory(connectionFactory,*new GenericObjectPool()*,null,null,false,false);

ObjectPool connectionPool = new GenericObjectPool(poolableConnectionFactory);
poolableConnectionFactory.setPool(connectionPool);


that uses a  "fake"  GenericObjectPool.
I don't think this is the right solution. What I am missing?

Thanks in advance.
Andrea

Reply via email to