views:

33

answers:

2

Hello everybody. I have a task to attach Oracle Coherence (it is cache software) in my project. One way of using it is Level2 Hibernate cache. I want to see when hibernate takes results from L2 cache. How can i do that? Both ways will be good: listener of some sort, if possible, or direct access to Cache object. Thanks in advance.

+1  A: 

I want to see when hibernate takes results from L2 cache.

Activate logging of all second-level cache activity. The relevant category is org.hibernate.cache.

Reference

Pascal Thivent
+1  A: 

The Coherence Hibernate L2 integration allows you to specify a system property to point to the coherence cache configuration that will be used by the L2 cache. If you point the "normal" coherence cache configuration to the same file, this will allow you to access the caches via CacheFactory.getCache.

-Dtangosol.coherence.cacheconfig=sample-cache-config.xml -Dtangosol.coherence.hibernate.cacheconfig=sample-cache-config.xml

You can download an example here: http://coherence.oracle.com/download/attachments/16730/hibernate-sample-src.jar

Patrick Peralta
Wow. Thanks for that! You are some kind of superhero!
foret