Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Cache Problem?

 
Rod McLure
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am new to hibernate
I have a jsp page with a Save button on it, which works fine for saving new records
if you are displaying saved data and change it , the changes get written to the database including a timestamp of when you saved
You are then forwarded to a "Load" action which uses the id from the save action to reload the screen from the database
The strange thing is one of the items on the database is a timestamp for when the save button was clicked, it is not entered from
the page, but it should display on the page
if I put a message in my "load" action to display the database fields from the object I have retrieved
I see any fields I changed on the form but the timestamp is always the value of the previous save. The first time it is null, the next time it is the previous value.
I am thinking it is caching this timestamp but I don't know what to do.

the app is developed using a HibernateSessionRequestFilter
....
ThreadLocalUser.set(currentUser);
//create the interceptor and add it to the HibernateSession
HibernateInterceptor interceptor = new HibernateInterceptor();
Session session = HibernateSessionFactory.getSession(interceptor);
.....
I don't really know what that means,
If anyone has suggestions it would help if you explained it to me as if you were talking to a five year old.
Thank you.





 
Rod McLure
Greenhorn
Posts: 24
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the postback, Rod!

Sometimes it seems like you're talking to yourself, but this type of kindness to the greater community really helps out.

Glad to have a Greenhorn like yourself on the ranch. Keep posting!

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic