Hibernate version:2.1.8
I'm using JBoss-Cache as the second level cache in Hibernate. The application is deployed across two nodes and the treecache.xml file has appropriate settings to enable asynchronous replication (REPL_ASYNC)
The problem is that state is maintained in an application cache also, there is no way to change this (legacy code). When a cache update (or insert) is received by the JBoss-Cache through cache replication, I need to propagate the change to my application cache. I found that I could do this by registering for cache events using the TreeCacheListener interface, however I can't figure out how to register my implementation of the TreeCacheListener with TreeCache. AFAIK the only way to register a listener is by calling TreeCache.addListener() - since I'm using Tree-Cache behind hibernate I don't have a reference to the TreeCache object. Is there a way to get a reference to the TreeCache object from Hibernate? I can always change the scope of net.sf.cache.TreeCache.cache from private to public static but would rather not play with the code if avoidable
I'm cross-posting to the jbosscache forum to find out if they have a solution...
|