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

Using OpenSessionInViewFilter in Spring-Hib-Wicket

 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I'm having a problem with the lazy loading exception...

Why does this happen? because i load some data and view it in a page, and here the session transaction ends... and when i try to delete one of the listed items i get the error as the session no longer exists...

the hibernate documentation recommended using OpenSessionInViewFilter to overcome this problem, but i found it too complicated to figure out exactly how to do it

I'm using applicationContext.xml where all my hibernate+spring wiring goes to..

what do i need to change in my xml file in order to make these session open as long as possible?

Thanks
 
Steve Hiller
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you ever figured this out? There is a good explanation in the Manning book called 'Wicket in Action'.
 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve

I figured out my mistake... I was trying to cache a service object that shouldn't be cached since it is used by all other pages...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic