-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to force clear the cache ?
PostPosted: Fri Jan 02, 2004 9:42 pm 
Regular
Regular

Joined: Tue Nov 04, 2003 12:37 pm
Posts: 57
Hello,

How can I force Hibernate to clear object cache ??

Eric


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2004 6:55 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Session cache (1st level)
Code:
session.evict(...);
or session.clear()


Second level cache
Code:
sessionFactory.evict(...);

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 18, 2004 9:08 am 
Beginner
Beginner

Joined: Fri Oct 10, 2003 10:30 am
Posts: 35
Location: Stockholm
From the Hibernate Javadoc
Quote:
public void evict(Class persistentClass)
throws HibernateException

Evict all entries from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.


What is the risk here? I don't get the warning.
Thanx


Top
 Profile  
 
 Post subject: Clear whole cache
PostPosted: Tue Apr 05, 2005 2:43 pm 
Beginner
Beginner

Joined: Thu Nov 20, 2003 8:13 pm
Posts: 31
Location: Newport Beach, CA
How can I get the following functionality:

Code:
sessionFactory.evict();


e.g., clear the entire second-level cache of persistent instances?

Is the only solution to loop through all the possible classes in the 2nd-level cache and call evict(<Classname>.class) for each one?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.