Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get List of objects from Second Level Cache

 
Ravi K Singh
Greenhorn
Posts: 3
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirment where I am using ehcache for hibernate second level cache.
It works fine for me as long as i fetch objects by identifier using load() or get().
But I want to fetch a list of objects using some criteria, this time to goes to database.
I want it to fetch data from second level cache every single time, as I have pre loaded my table in cache.

I don't want to use query cache, please advise if I can achieve my target using Second Level cache only.

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ravi as always", please check your private messages regarding an important administrative matter.

Thank you.
 
Ravi K Singh
Greenhorn
Posts: 3
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone please reply how to use createQuery() or createCriteria() on second level cache, i know it works only with load(id) or get(id). but any work arounds for the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic