commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Starbuck <skij...@yahoo.com>
Subject Re: GenericKeyedObjectPoolFactory
Date Sat, 12 Mar 2005 22:09:26 GMT
Vikram,
I'm confused. I want to create a pool of connections
and for each connection, pool the statements used on
the connection.  

The problem is the PoolableConnectionFactory will only
create a PoolingConnection if it was initialized with
an implementation of keyedObjectPoolFactory otherwise
it will just return the connection created by the
ConnectionFactory it was initialized with. In my case
that is a DriverManagerConnectionFactory. 

The most basic implementation of
keyedObjectPoolFactory is
GenericKeyedObjectPoolFactory which requires an
instance of KeyedPoolableObjectFactory.  There are no
concrete implementations of KeyedPoolableObjectFactory
in commons-pool and the only other suitable
implementation seems to be PoolingConnection in
commons-dbcp.  But that implementation requires a
Connection in order to initialize!

It seems to me like a chicken and egg problem:  In
order to create the factory to make connections that
pool statements I need to specify the factory that I
want to pool the statements but the only
implementation available requires a connection.

This is my second day with this package so please feel
free to fill me in on the right way to set this up.

thank you,


--- Vikram Goyal <tech@craftbits.com> wrote:
> Hi Mike,
> 
> You need to use the PoolingConnection class. It
> implements 
> KeyedPoolableObjectFactory. For some reason, the
> Javadocs for 
> KeyedPoolableObjectFactory don't reflect this.
> 
> HTH,
> Vikram
> 
>
---------------------------------------------------------------------------------------
> Jakarta Commons Online Bookshelf
> Module 9: Pool and DBCP:
> http://www.manning.com/catalog/view.php?book=goyal9
> All Modules: http://www.manning.com/goyal
>
---------------------------------------------------------------------------------------
> 
> ----- Original Message ----- 
> From: "Mike Starbuck" <skijore@yahoo.com>
> To: <commons-user@jakarta.apache.org>
> Sent: Saturday, March 12, 2005 9:08 AM
> Subject: GenericKeyedObjectPoolFactory
> 
> 
> > Is there a way to create an instance of
> > GenericKeyedObjectPoolFactory using an
> implementation
> > of BasekeyedPoolableObjectFactory.   I can't find
> a
> > concrete  class that impelments
> > KeyedPoolableObjectFactory in the commons-pool-1.2
> package.
> >
> > -- 
> >
> > The information contained in this email along with
> all attachments is 
> > confidential and is not to be shared without my
> permission and prior 
> > knowledge of who will be viewing it's contents
> including all attachments.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> >
> >
> >
> > 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 
> 

-- 

The information contained in this email along with all attachments is confidential and is
not to be shared without my permission and prior knowledge of who will be viewing it's contents
including all attachments.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message