This is weird, and is probably due to my inexperience with Hibernate. I'm making changes to my db through Hibernate, and sometimes I still get the old value.
In my web app, I use session.get(MyPoJo.class, pojoID)
When I invoke getName(), my object sometimes returns the name it had BEFORE I changed the db, and sometimes it returns the new saved name.
Interestingly, hibernate seems to be storing two versions of the object, and the session.get seems to return one or the other. Problem is, one is stale.
I've tried using session.refresh() on the object to force it to go back to the db, but the issue remains. I know this probably has something to do with the caching, but I'm lost, and very frustrated.
Any help is very much appreciated!
|