-->
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 can I expire all objects in the Hibernate cache?
PostPosted: Thu Dec 18, 2003 5:02 pm 
Newbie

Joined: Tue Nov 18, 2003 11:56 am
Posts: 16
In our application there is a separate non-java program that also inserts records in our database (in addition to our Java program). The result is that the Hibernate cache and the database are out of sync (and often Hibernate overwrites changed records). What is the best way to completely reset the Hibernate cache (both session and second-level)?

I guess I'm looking for something like evictAll().

Another question: what is a "roleName" and where do I define it? I'm trying to use the evictCollection(String roleName) of SessionFactory. Is it in the mapping files?


Thanks

_________________
Thanks
Per Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 1:56 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
From section 12.3 in the reference:
Quote:
To completely evict all objects from the session cache, call Session.clear()


Justin


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.