-->
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: How to refresh Hibernate L2 cache
PostPosted: Fri Apr 06, 2012 4:12 am 
Newbie

Joined: Wed Apr 04, 2012 11:48 pm
Posts: 4
Hi

Is there anyway can refresh Hibernate L2 cache at one time.

I just check the API of
org.hibernate.SessionFactory and org.hibernate.Cache
only found the API for evict. and there is no API for get all object or all ids from cache.

My requirement:
refresh Hibernate L2 cache at one time by particular region or particular class instance.

So this maybe like this:
get all the ids(or objects) from cache with region name or class type, evict all the data all the data, then reload them.

I can not found any API can get this information from cache.

Thanks,


Top
 Profile  
 
 Post subject: Re: How to refresh Hibernate L2 cache
PostPosted: Fri Apr 06, 2012 4:42 am 
Newbie

Joined: Wed Apr 04, 2012 11:48 pm
Posts: 4
I found this API:

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

can this API works?


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.