7 Replies Latest reply on Jun 16, 2010 9:14 AM by Sergey Graschenko

    jboss cache as hibernate 2nd level - cluster node doesn't persist replicated data

    Sergey Graschenko Newbie

      I'm trying to build an architecture basically described in user guide




      (Replicated caches with each cache having its own store.)


      but having jboss cache configured as hibernate second level cache.



      I've read manual for several days and played with the settings but could not achieve the result - the data in memory (jboss cache) gets _replicated_ across the hosts, but it's not _persisted_ in the datasource/database of the target (not original) cluster host.


      I had a hope that a node might become persistent at eviction, so I've got a cache listener and attached it to @NoveEvicted event.

      I found that though I could adjust eviction policy to fully control it, no any persistence takes place.


      Then I had a though that I could try to modify CacheLoader to set "passivate" to true, but I found that in my case (hibernate 2nd level cache) I don't have a way to access a loader.



      I wonder if replicated data persistence is possible at all by configuration tuning ?


      If not, will it work for me to create some manual peristence in CacheListener (I could check whether the eviction event is local, and if not - persist it to hibernate datasource somehow) ?


      I've used mvcc-entity configuration with the modification of cacheMode - set to REPL_ASYNC. I've also played with the eviction policy configuration.


      Last thing to mention is that I've tested entty persistence and replication in project that has been generated with Seam. I guess it's not important though.