• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Beginner trying to understand stale data

 
joe priv
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know what is causing this issue. I am using struts with hibernate. This is the use case:

start session
User can retrivebyId a Parent/Child many-to-many relation
fill in ActionForm . .
end session
forward jsp


This parent/child data is rendered in a form for user to change. User makes some changes to children and saves.

start session
retrivebyId . .
update()
commit()
end session

user nows wants to go back to the same data
start session
retrivebyId . .
fill in ActionForm . .
end session

Old (stale) children data is being displayed. These are request based transactions. I can query the db directly and see the changes in the db, but the children are not being re-loaded from the DB, it is as if they are cached somewhere. where? How can I get around this?

Thanks




User
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you getting the Session object? Are you calling close() on the session object after each request? It there any possibility that the browser is just caching the page?

Mark
 
joe priv
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!

I need to look at how the sessions are being created and closed. This logic is built in a basedao that I havn't paid much attention to. Today for the most part I tried setting lazy="false" on everything possible thinking that would solve the problem.

Joe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic