commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <>
Subject [DBCP2] Timeout on PoolingDataSource#getConnection() ?
Date Thu, 30 Apr 2015 20:40:41 GMT
I'm using dbcp2-2.1 and pool2-2.3.

Is there any kind of timeout configurable (or even needed) when calling
getConnection() on a PoolingDataSource?  I was looking over my code for
possible problems and realized that I have no idea whether this call
might block indefinitely or whether it will always finish (or throw an
exception) within some reasonable timeframe.  The javadocs don't offer
anything useful, which hopefully means that there is no possibility of a
significant or indefinite pause.

Below is the code I'm using to initialize.  In this code, dsMaster is an
instance of javax.sql.DataSource, and one of the objects where I call

 ConnectionFactory cfMaster = new
DriverManagerConnectionFactory(masterUrl, dbUser, dbPass);
 PoolableConnectionFactory pcfMaster = new
PoolableConnectionFactory(cfMaster, null);
 opMaster = new GenericObjectPool<>(pcfMaster);
 dsMaster = new PoolingDataSource<>(opMaster);


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message