When we shutdown our EHCacheAdapter, go through and flush everything from

memory so that if we turn around and recreate a PersistenceContext with a brand
new classloader and start loading things from the cache, we don't have
freakoutery because there's a record in memory that was resolved with the old
classloader. Plus it allows those old classloaders to get collected.
This commit is contained in:
Michael Bayne
2009-07-10 23:29:36 +00:00
parent 2336246b40
commit bc7a31c661
@@ -140,6 +140,13 @@ public class EHCacheAdapter
{
log.debug("EHCacheAdapter shutting down", "lookups", _lookups,
"stores", _stores, "removes", _removes, "enumerations", _enumerations);
// go through and flush all of the caches we resolved
for (Ehcache cache : _categories.values()) {
cache.flush();
}
_categories.clear();
_bins.clear();
}
/**