I am using Hibernate and Spring for my web application.
In database operation, Hibernate is caching entities and returning them in next request without reading the a
Call refresh entity session.refresh(entity)
session.refresh(entity)
Open new session then call session2.get(EntityClass.class,id) it will pull the entity from the database
session2.get(EntityClass.class,id)
Session session2=sessionFactory.openSession(); EntityClass entity=(EntityClass) session2.get(EntityClass.class, id);