Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query when Using EHCache mechanism

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"Objects can be evicted from the cache by calling the Session.evict() method . "


I am having a Query with respect to above statement .

My understanding with respect to above statement is not applicabe if one uses Second Level Cache such as EHCache .
AS session is only associated with First Level Cache

Please share your ideas
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session.evict() evicts stuff from the Session, and the Session is the first level cache. It doesn't evict stuff from the second level cache, hence all the evict methods in the SessionFactory class. See the JavaDocs.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Paul ,


so i think using SessionFactory.evict is the solution for this .Am i Right ??

The ehcache.xml looks like this
-------------------------


Please tell how exactly the Mydir (above path) looks like exactly , and what is the life time of it ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I don't use EHCache. This sort of stuff must be covered in their documentation though. Hacve you read through this?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic