I have a java process which is multi threaded using ExecutorService (15 threads). Each thread calls store procedure to insert data to table, my connection to be pooled across 15 threads so that I could see multiple commits on the table at the same time, but i only see one connection established for one active thread even through 15 threads are ready and waiting.
Driver: oracle.jdbc.driver.OracleDriver
Following are the connection details I have in my properties file url, username, password
Class.forName(DB_DRIVER);
DataSource oracleDataSource = new DriverManagerDataSource(DB_CONNECTION, DB_USER,DB_PASSWORD);
ObjectPool objectPool = new GenericObjectPool();
DataSourceConnectionFactory datasourceConnectionFactory = new DataSourceConnectionFactory(oracleDataSource);
PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(datasourceConnectionFactory, objectPool, null, null, false, true);
objectPool.setFactory(poolableConnectionFactory);
PoolingDataSource datasource = new PoolingDataSource(objectPool)