• 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

HQL not selecting data added through backend

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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()
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Francois
reply
    Bookmark Topic Watch Topic
  • New Topic