Author: psteitz Date: Sun Jan 17 22:04:30 2010 New Revision: 900226 URL: http://svn.apache.org/viewvc?rev=900226&view=rev Log: Eliminated poolKeys cache from PerUserPoolDataSource. JIRA: DBCP-320.
Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java commons/proper/dbcp/trunk/xdocs/changes.xml Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java?rev=900226&r1=900225&r2=900226&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java (original) +++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java Sun Jan 17 22:04:30 2010 @@ -54,8 +54,6 @@ private static final long serialVersionUID = -3104731034410444060L; - private static final Map poolKeys = new HashMap(); - private int defaultMaxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE; private int defaultMaxIdle = GenericObjectPool.DEFAULT_MAX_IDLE; private int defaultMaxWait = (int)Math.min(Integer.MAX_VALUE, @@ -439,27 +437,9 @@ ref.add(new StringRefAddr("instanceKey", instanceKey)); return ref; } - - private PoolKey getPoolKey(String username, String password) { - PoolKey key = null; - String name = username + password; - String dsName = getDataSourceName(); - synchronized (poolKeys) { - Map dsMap = (Map) poolKeys.get(dsName); - if (dsMap != null) { - key = (PoolKey) dsMap.get(name); - } - - if (key == null) { - key = new PoolKey(dsName, name); - if (dsMap == null) { - dsMap = new HashMap(); - poolKeys.put(dsName, dsMap); - } - dsMap.put(name, key); - } - } - return key; + + private PoolKey getPoolKey(String username, String password) { + return new PoolKey(getDataSourceName(), username+password); } private synchronized void registerPool( Modified: commons/proper/dbcp/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/xdocs/changes.xml?rev=900226&r1=900225&r2=900226&view=diff ============================================================================== --- commons/proper/dbcp/trunk/xdocs/changes.xml (original) +++ commons/proper/dbcp/trunk/xdocs/changes.xml Sun Jan 17 22:04:30 2010 @@ -49,6 +49,9 @@ changes below since 1.2.2 applies to both the 1.3 and 1.4 release. Other than the one issue related to adding JDBC 4 support (DBCP-191), all bug fixes or new features are included in both DBCP 1.3 and 1.4 "> + <action dev="psteitz" type="fix" issue="DBCP-320"> + Eliminated poolKeys cache from PerUserPoolDataSource. + </action> <action dev="sebb" type="fix" issue="DBCP-321"> Eliminated userKeys LRUMap cache from SharedPoolDataSource. </action>