-
1. Re: eviction errors
drosenbaum Apr 4, 2005 2:19 PM (in response to drosenbaum)Actually, I traced these errors to consistenly happen after I do the following:
cache.remove("/");
to remove all the contents of the cache. Is this in effect not a legal thing to do, since I get those eviction errors afterward? If it is not, what is the proper way to clear the contents of the entire cache?
Thanks,
Daniel -
2. Re: eviction errors
ben.wang Apr 4, 2005 6:07 PM (in response to drosenbaum)I am just curious why do you need to turn on eviction policy using Hibernate. Isn't Hibernate has its own policy or I am mistaken? I will need to double check this with Gavin.
Second of all, we are planning to provide an API that can clean up the whoe cache content so you dont need to do it like this.
-Ben -
3. Re: eviction errors
ben.wang Apr 4, 2005 6:35 PM (in response to drosenbaum)Ok, just check with Gavin. Hibernate leaves the underlying cache to evict the nodes. So it is kosher. But question is why do you need to clean up the whole tree while turning on eviction though?
-Ben -
4. Re: eviction errors
drosenbaum Apr 4, 2005 10:28 PM (in response to drosenbaum)Thanks for the answer Ben. In my application, I have certain data that periodically gets loaded into the database by a different app, a batch load process. I would like to clear my cache after this load process, so that a new database load is forced and the new data would be used, rather than the old stale cached data.
Also, rather than trying to predict which regions or nodes would likely get updated, I would rather just clear the entire thing. This event happens infrequently enough that I am not concerned with a performance hit of needing to reload everything, but when this process happens my requirement is to use the new data right away.
I understand that you will have a future API to clear the cache, but do you have a recommendation how I could do this right now? I was thinking about iterating over every element stored in the cache and calling remove() on it but this seems terribly inefficient, and seems to me would result in thousands of jgroup calls. Also, I am concerned that since other threads may be adding nodes while the clearing thread is taking place, wouldn't this possibly leave the cache in an inconsistent state?
I am not sure how to go about this and any help or advice is appreciated.
Thanks again,
Daniel -
5. Re: eviction errors
drosenbaum Apr 7, 2005 10:54 PM (in response to drosenbaum)Hi,
There still has not been a response. Does anyone have a suggestion please how to clear the entire cache right now? And is it wrong to simply do cache.remove("/")? If so why is it wrong, will memory not be freed up or something like that? And why would the eviction class log these as errors?
Thanks,
Daniel