Menu

#4 MultiManager did not release instances

open
nobody
None
5
2004-09-21
2004-09-21
Carlo Rossi
No

On MultiCacheManager.shutDown() every manager get
closed but then the instances map remain full and on a
successive cacheFactory.createCache() I get a null cache.
On Hibernate under JBoss this lead to a NPE when hot
deploy of application bring to a call to
cacheFactory.createCache().

I suggest the removing of instance in MultiCacheManager
during shutdown:

/\*
 \*  Shutdown all the managers in the list
 \*  @author Rajeev Kaul
 \*/
public static synchronized void shutDown\(\) \{
    if \(\!instances.isEmpty\(\)\) \{
        Set keys = instances.keySet\(\);
        Iterator iter = keys.iterator\(\);
        String key;
        MultiCacheManager manager;
        while \(iter.hasNext\(\)\) \{
            key = \(String\) iter.next\(\);
            manager = \(MultiCacheManager\) instances.get\(key\);
            manager.close\(\);

+ iter.remove();
}
}
}

Discussion


Log in to post a comment.