File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes How to check  Secondary Cache? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to check  Secondary Cache?" Watch "How to check  Secondary Cache?" New topic

How to check Secondary Cache?

Ramana Kamal

Joined: Dec 29, 2006
Posts: 1
Hi all,
I have configured Hibernate secondary level cache using EhCache.I have Ehcache.xml in classpath and i updated cache provider class in My hibernate configuration file.Now my doubt is is there any way we can test wheather caching is working or not?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63868

"Ramana KK",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

You can always enable Hiberate statistics and see hit miss ratio, this will tell you if it is getting things from the second level cache.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Lakshmi Dasari
Ranch Hand

Joined: Mar 03, 2003
Posts: 35
You need to enable statistics inorder to see the hit / miss ratio. Make sure you have the property

enabled in your hibernate configuration file.

[ January 01, 2007: Message edited by: Lakshmi Dasari ]
[ January 01, 2007: Message edited by: Lakshmi Dasari ]

I agree. Here's the link:
subject: How to check Secondary Cache?
It's not a secret anymore!