1 Reply Latest reply on Dec 18, 2006 7:15 AM by Manik Surtani

    problems with jalapeno/cayenne JBC optimistic cache with inv

    keith nielsen Newbie

      After debugging and reading through the code, it seemed to me that jalapeno/cayenne JBC will always send an eviction on any put to the cache. The problem I am facing goes as follows:

      I am using hibernate for persistence in a clustered environment. hibernate is running in side of a servlet container (SunONE to be specific). I planned on using JBC optimistically with asynchronous invalidations but when I run under this configuration I get the following problem:

      A loads X.v1 from the database.
      A sends invalidation(eviction) on put to local JBC (since B is empty no worries).
      A has warm cache

      B loads X.v1 from the database.
      B sends invalidation(eviction) on put to local JBC.
      B has warm cache

      A evicts X.v1 from cache and now has a cold cache even though the data has not changed.

      Is this a known issue/feature? I cant imagine we are the only organization that wishes to run under this configuration.

      Looking at the code it seems that the InvalidationInterceptor only operates in this way (sending evictions).

      I can send configs and such if need be.

      Thanks in advance,

        • 1. Re: problems with jalapeno/cayenne JBC optimistic cache with
          Manik Surtani Master

          This really depends on your use case. If you want a warm cache, replication is the best option.

          Invalidation only really makes sense if you have a large data set (e.g., 50GB of data) and each node only handles a small subset of this data (e.g., 0.5GB). THis way it is extremely unlikely that 2 nodes would need the same data in memory at any given point. And as such,if data changes on one node, it should be evicted on other nodes - if the other nodes have it in memory.

          OTOH, if you are using it to cache a set of drop down values, for example, which are needed on all nodes all the time, use replication.