General J2EE: need to see hibernate cache contents configured using coherence
How do I see contents of hibernate second level
- Posted by: hari sujathan
- Posted on: January 28 2005 09:22 EST
cache configured using coherence. I tried using both weblogic & tomcat
1. I did add to hibernate configuration
2. after compiling CoherenceCacheProvider.java and
(http://www.hibernate.org/132.html) and put in
Application worked fine without any errors in
weblogic 8.1. (note: application doesn't work when the CoherenceCacheProvider/CoherenceCache files or coherence.jar/tangosol.jar are not in classpath-- that means it is using these files)
But still no "keys" get populated after I ran-
"com.tangosol.examples.explore.SimpleCacheExplorer" in another window. I am using default configuration that came with coherence.
I need to show people here how the cache contents are
Anyone done this before?
If so please explain setup.
- need to see hibernate cache contents configured using coherence by Rob Misek on January 28 2005 11:56 EST
I would suggest using the Coherence command line application to view the data stored in the L2 caches. To start the command line application, set up your classpath and then use the following command: 'java com.tangosol.net.CacheFactory'. Then, you will have to "bring focus" to the specific cache you want to look at with the following command 'cache <region_name>' (Hibernate creates the caches using the internal region name). Then you can do any number of operations including 'list', 'size', 'get <key>', etc.
I would also suggest taking a look at this FAQ item. It covers the details on how to configure the CoherenceCacheProvider to use different caching topologies. By default (using the default coherence-cache-config.xml; located at the root of coherence.jar) the CoherenceCacheProvider uses a replicated cache. If you are going to be storing a large amount of data in the L2 cache you may be interested in using the partitioned cache (i.e. 'distributed-scheme').
Coherence: It just works.
The info was useful to see various regions that hibernate created. ( regions were also created based on the FQN of POJOs ).
I put one SOP in CoherenceCacheProvider constructor to get the region names, and switched using "cache <region name>".