connectionPool.setMaxActive(maxActive); statementPool = new GenericKeyedObjectPoolFactory(null);
GenericObjectPool connectionPool = new GenericObjectPool(null); ... connectionPool.setTestOnBorrow(true); // test the connection before its made ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI,username, password); final String validationQuery = null; KeyedObjectPoolFactory statementPool = new GenericKeyedObjectPoolFactory(null); PoolableConnectionFactory factory = new PoolableConnectionFactory(connectionFactory, connectionPool, statementPool, validationQuery, defaultReadOnly, defaultAutoCommit); factory.setValidationQuery("select 1"); // validate the connection with this statement
connectionPool.setMaxActive(maxActive); statementPool = new GenericKeyedObjectPoolFactory(null);
if (MapUtils.getBoolean(properties, "net.ontopia.topicmaps.impl.rdbms.ConnectionPool.PoolStatements", true)) { log.debug("Using prepared statement pool: Yes"); stmpool = new GenericKeyedObjectPoolFactory(null, -1, // unlimited maxActive (per key) GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL,
new GenericKeyedObjectPoolFactory( null, pool.getMaxActive(), pool.getWhenExhaustedAction(), pool .getMaxWait(), pool.getMaxIdle(), maxOpenPreparedStatements );
statementPoolFactory = new GenericKeyedObjectPoolFactory(null, -1, // unlimited maxActive (per key) GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL,
statementPoolFactory = new GenericKeyedObjectPoolFactory(null, -1, // unlimited maxActive (per key) GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL,
statementFactory = new GenericKeyedObjectPoolFactory( null, maxActiveStmts,
statementFactory = new GenericKeyedObjectPoolFactory( null, maxActiveStmts,
if (isPoolPreparedStatements()) statementPoolFactory = new GenericKeyedObjectPoolFactory(null, -1, // unlimited maxActive (per key) GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL, 0, // maxWait 1, // maxIdle (per key)
statementPoolFactory = new GenericKeyedObjectPoolFactory(null, -1, // unlimited maxActive (per key) GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL,
if (isPoolPreparedStatements()) statementPoolFactory = new GenericKeyedObjectPoolFactory(null, -1, // unlimited maxActive (per key) GenericKeyedObjectPool.WHEN_EXHAUSTED_FAIL, 0, // maxWait 1, // maxIdle (per key)
GenericObjectPool.DEFAULT_TEST_WHILE_IDLE); return new GenericKeyedObjectPoolFactory( null, maxActive,
GenericObjectPool.DEFAULT_TEST_WHILE_IDLE); return new GenericKeyedObjectPoolFactory( null, maxActive,