• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Query when Using EHCache mechanism

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic