openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1737410 - /openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
Date Fri, 01 Apr 2016 15:03:05 GMT
Author: hthomann
Date: Fri Apr  1 15:03:05 2016
New Revision: 1737410

URL: http://svn.apache.org/viewvc?rev=1737410&view=rev
Log:
OPENJPA-2636: Updated a Map in Configurations to avoid a ClassLoader leak.

Modified:
    openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java

Modified: openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=1737410&r1=1737409&r2=1737410&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
(original)
+++ openjpa/branches/2.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
Fri Apr  1 15:03:05 2016
@@ -203,7 +203,9 @@ public class Configurations {
             Object key = loader == null ? NULL_LOADER : loader;
             Map loaderCache = (Map) _loaders.get(key);
             if (loaderCache == null) { // We don't have a cache for this loader.
-                loaderCache = new ConcurrentHashMap();
+                //OPENJPA-2636: Changed to HARD/WEAK to avoid Classloader leak:
+                loaderCache = new ConcurrentReferenceHashMap(ConcurrentReferenceHashMap.HARD,

+                    ConcurrentReferenceHashMap.WEAK);
                 _loaders.put(key, loaderCache);
             } else {  // We have a cache for this loader.
                 cls = (Class) loaderCache.get(clsName);



Mime
View raw message