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()
posted 6 years ago
You can either remove the cache at the Employee class level
Or remove the cache for all classes in yout hibernate.properties file