5 Replies Latest reply on Apr 7, 2005 10:54 PM by Daniel Rosenbaum

    eviction errors

    Daniel Rosenbaum Newbie

      Hi,

      I constantly get exceptions such as this, using JBossCache with Hibernate:

      
      01 Apr 2005 12:27:37,217 WARN org.jboss.cache.eviction.LRUAlgorithm - evict(): Node not found with this fqn: //org/ifmc/qies/qw/data/po/QwEnvrmt Could have been evicted earlier already
      
      01 Apr 2005 12:27:37,218 ERROR org.jboss.cache.eviction.EvictionTimerTask - run(): error processing eviction with exception: org.jboss.cache.eviction.EvictionException: LRUAlgorithm.removeFromQueue(): internal error. Can't find fqn in nodeMap. fqn: //org/ifmc/qies/qw/data/po/QwEnvrmt will reset the
      eviction queue list.
      
      



      Errors such as these fill up my error log quite a bit (I log warnings and errors) but I am not so concerned about such errors, as they are only evictions that may have already taken place. Would it be possible to either:

      1) Make it a configuration setting whether the user would like to see these particular errors and warnings.

      or

      2) At least log these particular messages in its own logging Category (such as org.jboss.cache.eviction.LRUAlgorithm.EvictNodeNotFoundError and/or org.jboss.cache.eviction.EvictionTimerTask.EvictNodeNotFoundError), so in my log4j config I can switch logging off for these categories. (I would not want to turn off the LRUAlgorithm or EvictionTimerTask categories themselves, otherwise I would miss other more important and legitimate errors and warnings).

      Thank you,
      Daniel


        • 1. Re: eviction errors
          Daniel Rosenbaum Newbie

          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 Master

            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 Master

              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
                Daniel Rosenbaum Newbie

                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
                  Daniel Rosenbaum Newbie

                  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