Looking for advice on best practice for getting Connections when using the Oracle UCP Connection Pool Manager. I can't tell from the documentation if you're supposed to keep refs to your PoolDataSource objects, and get the Connections from them, or if you should just use your Manager to get Connections with some code like this:
(Connection)getConnectionPool(connectionPoolName).borrowConnection(getRetrievalMap().get(connectionPoolName)).getPhysicalConnection();
All the examples seem to use the PoolDataSource objects to get their connections. Do people keep those around, and then just use the Manager to do adminstrative things with the Pools? Or do they get the java.sql.Connection objects directly from the Manager with getPhysicalConnection()? I'm a little worried about using getPhysicalConnection(), not sure if the pool would know about it. For example, would closing a Connection obtained with getPhysicalConnection() go back into the pool?
Is there a better way to get Connections from the Manager that I'm not seeing?