I am using oracle.jdbc.pool.OracleDataSource to pool pools. I would like the pool to check if the connection was closed properly and to catch up with it. I tried the following:
ods = new OracleDataSource();
ods.setConnectionCachingEnabled(true);
ods.setConnectionCacheName(CACHE_NAME);
Properties cacheProps = new Properties();
cacheProps.setProperty("MinLimit", Integer.toString(1));
cacheProps.setProperty("MaxLimit", Integer.toString(6));
cacheProps.setProperty("InitialLimit", "1");
cacheProps.setProperty("AbandonedConnectionTimeout", "2");
ods.setConnectionCacheProperties(cacheProps);
I connect active connections as follows:
occm = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
occm.getNumberOfActiveConnections(CACHE_NAME);
If I do not close the connection in the application, the pool just fills to 6, so
cacheProps.setProperty("AbandonedConnectionTimeout", "2");
does not work. Why?
Any hint would be appreciated
source
share