-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Get the EhCache instance
PostPosted: Tue May 16, 2006 8:57 am 
Beginner
Beginner

Joined: Tue Nov 22, 2005 5:33 am
Posts: 31
I want to see all the objects stored in the cache, but how can I do it?
There's no getCache()-method in the session class.

The class EhCache has this method:

/**
* Get an item from the cache
*/
Object read(Object key){}


If I could somehow get the instance of EhCache I could call this method, but I canĀ“t find it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 16, 2006 1:44 pm 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
From the docs :

Quote:
To browse the contents of a second-level or query cache region, use the Statistics API:

Map cacheEntries = sessionFactory.getStatistics()
.getSecondLevelCacheStatistics(regionName)
.getEntries();

You'll need to enable statistics, and, optionally, force Hibernate to keep the cache entries in a more human-understandable format:

hibernate.generate_statistics true
hibernate.cache.use_structured_entries true


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.