Skip to content

Commit dcc3d5c

Browse files
committed
DM-10370: response from feedback
1 parent 0f5c5ea commit dcc3d5c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/firefly/java/edu/caltech/ipac/firefly/server/cache/EhcacheProvider.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,17 @@ public class EhcacheProvider implements Cache.Provider {
6666
File ignoreSizeOf = getConfFile("ignore_sizeof.txt");
6767
System.setProperty("net.sf.ehcache.sizeof.filter", ignoreSizeOf.getAbsolutePath());
6868

69+
// Two 2 tries to start cache manager:
70+
// 1. The first time will only work in the single app deployment such the firefly standalone version.
71+
// Ehcahce is not deployed in the tomcat lib directory.
72+
//
73+
// 2. In the typical multi app production case there will be an exception, because ehcache is in the tomcat lib
74+
// directory and has a different class loader. Then the cache manager will start without
75+
// the sizeofEngine override. To use the sizeofEngine wrapper in multi app production case it would need to
76+
// be a jar that is placed in the tomcat lib directory alone with EHcache.
6977
try {
70-
System.setProperty("net.sf.ehcache.sizeofengine.shared.VIS_SHARED_MEM",
71-
"edu.caltech.ipac.firefly.server.cache.ObjectSizeEngineWrapper");
78+
String sizeEngName= ObjectSizeEngineWrapper.class.getName();
79+
System.setProperty("net.sf.ehcache.sizeofengine.shared.VIS_SHARED_MEM", sizeEngName);
7280
sharedManager = CacheManager.create(sharedConfig.getAbsolutePath());
7381
} catch (RuntimeException e) {
7482
System.clearProperty("net.sf.ehcache.sizeofengine.shared.VIS_SHARED_MEM");

0 commit comments

Comments
 (0)