This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes using session.clear and session.evict Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "using session.clear and session.evict" Watch "using session.clear and session.evict" New topic

using session.clear and session.evict

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528


what is the difference in clearing the cache using session.evict and session.clear ??

please suggest your ideas

If you want something you never had do something which you had never done
Reehan Lalkhanwar
Ranch Hand

Joined: Jun 16, 2007
Posts: 106
session.clear(): Completely clear the session.
session.evict(Object object): Remove this instance from the session cache. i.e. the object that's passed.

Thank you,
I agree. Here's the link:
subject: using session.clear and session.evict
Similar Threads
Hibernate: How to prevent insert and delete?
Problem with Hibernate Cache
HOw to manage the session object after transaction is completed?
Hibernate or browser caching DB results?
session.clear when to use