File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Using OpenSessionInViewFilter in Spring-Hib-Wicket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Using OpenSessionInViewFilter in Spring-Hib-Wicket" Watch "Using OpenSessionInViewFilter in Spring-Hib-Wicket" New topic

Using OpenSessionInViewFilter in Spring-Hib-Wicket

H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172

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?

Steve Hiller

Joined: Jul 25, 2008
Posts: 7
Do you ever figured this out? There is a good explanation in the Manning book called 'Wicket in Action'.
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
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...
I agree. Here's the link:
subject: Using OpenSessionInViewFilter in Spring-Hib-Wicket
It's not a secret anymore!