0

I am creating pools to test Oracle replay using Transparent Application Continuity.

I have my basic Java code that does this.

     
            OracleDataSourceImpl ds = new oracle.jdbc.replay.OracleDataSourceImpl();
            ds.setURL(WALLET_URL);
            ConnectionFactory connectionFactory = new DataSourceConnectionFactory(ds);
            PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,null);

            GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
            poolConfig.setMaxTotal(5);
            poolConfig.setMinIdle(4);

            ObjectPool objectPool = new GenericObjectPool(poolableConnectionFactory, poolConfig);
            poolableConnectionFactory.setPool(objectPool);
            PoolingDataSource dataSource = new PoolingDataSource(objectPool);

            conn = dataSource.getConnection();

I was under the impression from DBCP that poolConfig.setMaxTotal(5) would give me 5 pool connections to my Oracle DB. When I check the number of connections in Oracle I only see one. If I use the BasicDataSource and set setInitialSize(5) I get 5 pool connections to my Oracle DB. How can i do this correctly? Thanks.

cptkirkh
  • 107
  • 1
  • 9

0 Answers0