I'm creating connection manager class that would return java.sql.Connection
to the customers of the class.
My goal is to always have 2 available connections in pool so I wouldn't loose time for creating connections. When I return the available connection, I need to make Oracle UCP create new available connection, so it would be always 2 connections available.
The problem is Oracle UCP doesn't have an option to control it. I've read the UCP documentation, but hadn't found any solution.
There is setMinPoolSize()
method, but it controls available + borrowed connections, not only the available ones.
Also there is a harvestable connection functionality, but it harvests existing (borrowed) connections instead of creating new.
Note:
I'm using Oracle 11.2.0.3 and the latest ucp.jar
(for Oracle 11.2.0.3)