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

Posted by Sergey Grashchenko on Stack Overflow See other posts from Stack Overflow or by Sergey Grashchenko
Published on 2010-06-10T15:32:26Z Indexed on 2010/06/10 15:32 UTC
Read the original article Hit count: 263

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate