• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL not selecting data added through backend

 
Sagar Kale
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one page which shows list of employees. Now load this page in browser and it shows 1 employee. I add employee directly in database through backend procedure( Now table contains 2 employees). When I refresh my webpage which shows employee list, it does not contain newly added employee through backend procedure. When I do refresh on web page, I see hibernate query which selects data from employee table. But new added employee through backend procedure does not come on web page. Which means hibernate has picked up data through cache. How do I force hibernate not to use cache and fire new select on database?
I am using HQL createQuery(" from Emp ").list()
 
Francois Nadeau
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sagar,

You can either remove the cache at the Employee class level



Or remove the cache for all classes in yout hibernate.properties file



Hope this helps.
 
Sagar Kale
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Francois
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic