views:

22

answers:

0

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

http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs/3.2.1.GA/userguide_en/html/cache_loaders.html#d0e3090

(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.