Details
Description
initConnectionPool does not allow us to configure the GenericKeyObjectPool.
Suggestion:
PooledConnectionFactory
private GenericKeyedObjectPoolConfig config; public void setBasePoolConfig(final GenericKeyedObjectPoolConfig config) { this.config = config; } public void initConnectionsPool() { if (this.connectionsPool == null) { this.connectionsPool = new GenericKeyedObjectPool<ConnectionKey, ConnectionPool>(blah, config==null?new GenericKeyedObjectPoolConfig():config); } } protected ConnectionPool createConnectionPool(Connection connection) { return new ConnectionPool(connection, config); }
ConnectionPool
public ConnectionPool(Connection connection) { this(connection, new GenericKeyedObjectPoolConfig()); } public ConnectionPool(Connection connection, GenericKeyedObjectPoolConfig config) { this.connection = wrap(connection); this.sessionPool = new GenericKeyedObjectPool<SessionKey, SessionHolder>(blah, config==null?new GenericKeyedObjectPoolConfig():config); }