aspose file tools*
The moose likes Other Application Frameworks and the fly likes OpenSessionInViewFilter closes session during view loading (Spring+Hibernate) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "OpenSessionInViewFilter closes session during view loading (Spring+Hibernate)" Watch "OpenSessionInViewFilter closes session during view loading (Spring+Hibernate)" New topic
Author

OpenSessionInViewFilter closes session during view loading (Spring+Hibernate)

Emili Calonge
Ranch Hand

Joined: May 17, 2003
Posts: 84
Hi!

I'm developing an application using Spring 2.5 and Hibernate 3. I've configured the opensessioninviewfilter interceptor and changed all the relations to Lazy. As I understand it the interceptor should keep the Hibernate session open until the html rendering is done, but in the jsp's if I try to load a property through an object relation I get this error: "org.hibernate.LazyInitializationException: could not initialize proxy - no Session".

The code I have in the web.xml file is:


Anybody chas any idea why this isn't working?
Thanks a lot!
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Do you have any other filters defined?


GenRocket - A Test Data Generation Platform
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: OpenSessionInViewFilter closes session during view loading (Spring+Hibernate)
 
Similar Threads
OpenSessionInViewFilter problem
Spring MVC - no ContextLoaderListener registered
Struts 2+Tiles+Spring Core+Spring Security
Struts Spring Integration problem
DBUnit, why insert test data, only to delete/re-create tables after?