Hibernate version: 2.1
I'm a newbie to Hibernate, and can't find help on why my User object doesn't reflect changes made in the database between calls. For example:
1) session.load User object. Let's say the name is "Ving"
2) Display User object on jsp. Displays "Ving".
3) Change the user's name in the database manually to "Bing".
4) session.load User object.
5) Display User object on jsp. Still displays "Ving", rather than "Bing".
My load code basically looks like:
Session session = HibernateFactory.currentSession();
User user = (User) session.load(User.class, new Integer(id));
HibernateFactory.closeSession();
I have tried a number of variations on session.refresh(), session.flush(), etc., but nothing seems to work.
Any ideas on what the problem is?
|