commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <phil.ste...@gmail.com>
Subject Re: [DBCP] Connection gets blocked on 9th connection.
Date Thu, 09 Aug 2007 06:10:12 GMT
On 8/8/07, Dave, Tushar <tushar.dave@employease.com> wrote:
> Thanks a lot Phil.
>
> I am using the DriverManagerConnectionFactory instead of
> DataSourceConnectionFactory and it works fine.
>
> BasicDataSource does not have an option to specify the
> When Exhausted Action. If I use BasicDataSource then how can I specify
> this parameter.
>
You can't set this pool parameter using BasicDataSource directly.  If
you really need to change the default (WHEN_EXHAUSTED_BLOCK), then you
either have to follow the pattern in the
ManualPoolingDataSourceExample, creating the pool yourself and setting
its properties before using it to create a PoolingDataSource, or
subclass BasicDataSource and add a setter that sets this property on
the (protected) connectionPool member.

Phil

 Original Message-----
> From: Phil Steitz [mailto:phil.steitz@gmail.com]
> Sent: Tuesday, August 07, 2007 8:13 PM
> To: Jakarta Commons Developers List
> Subject: Re: [DBCP] Connection gets blocked on 9th connection.
>
> Tushar,
>
> If you want to use BasicDataSource, you need to set the pool
> properties using its setters (i.e., using the setters on the
> BasicDataSource instance).  It is designed to take care of creating
> and managing the underlying pool and PoolingDataSource for you.
>
> Have a look at the examples here:
>
> http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/
>
> The BasicDataSourceExample defaults the pool parameters, but
> ds.setMaxIdle, etc could be added to the setupDataSource method there
> to set those parameters.
>
> The ManualPoolingDataSourceExample shows how to do it if you want to
> create the pool yourself and "manually" create the PoolingDataSource
> from it.
>
> Phil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

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


Mime
View raw message