commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: How to tell how TestOnBorrow is set
Date Wed, 06 May 2009 09:33:31 GMT
Green, Kay wrote:
> I am trying tell what testOnBorrow is set to for my GenericObjectPool.
>
>  
>
> Here is how I am constructing my GenericObjectPool
>
>  
>
> ObjectPool connectionPool = 
>
>                 new GenericObjectPool(
>
>                 null,
>
>                 8, // maxActive
>
>                 GenericObjectPool.WHEN_EXHAUSTED_GROW, //
> whenExhaustedAction
>
>                 GenericObjectPool.DEFAULT_MAX_WAIT, //maxWait
>
>                 true, //testOnBorrow
>
>                 true); // testOnReturn
>
>  
>
> but ObjectPool does not have getTestOnBorrow.
>
>  
>
> I am creating ObjectPool object because PoolingDataSource needs
> ObjectPool in its connection
>
>  
>
> Any help would be appreciated on how to tell what the parameters are set
> to.
>
>   
The constructor call above sets the parameters.  To verify, you could 
cast connectionPool back to GenericObjectPool
((GenericObjectPool) connectionPool).getXxx()
>  
>
> What I am trying to do is create a database connection pool.
>   
Unless you need the control provided by the "manual" setup, it might be 
easier to just use BasicDataSource, which exposes the configuration 
properties.

Phil
 

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


Mime
View raw message