[ http://jira.andromda.org/browse/SPRING-69?page=comments#action_11521 ]
     
Matthias Bohlen commented on SPRING-69:
---------------------------------------

As far as I recall from the Hibernate in Action book, the "open session in 
view" pattern is discouraged. Unfortunately, I do not remember why. Just wanted 
to give a "heads up" on this.

Cheers...
Matthias


> Adapting OpenSessionInViewFilter to AndroMDA
> --------------------------------------------
>
>          Key: SPRING-69
>          URL: http://jira.andromda.org/browse/SPRING-69
>      Project: Spring Cartridge
>         Type: New Feature
>  Environment: Web application on Tomcat servlet container
>     Reporter: Sebastien Arbogast
>     Assignee: Chad Brandon
>  Attachments: OpenSessionInViewFilterForAndromda.java
>
> To prevent the common "lazy loading" bug in the web tier, Spring framework 
> provides a utility servlet filter : OpenSessionInViewFilter. Unfortunately 
> this filter is not very flexible and it looks for the sessionFactory bean 
> directly in root application context whereas in the structure of Spring 
> configuration files generated by AndroMDA, it's one level down in 
> applicationContext.xml
> So with the default configuration of OpenSessionInViewFilter in web.xml, web 
> application initialization works fine but on the first filtered request, you 
> get an internal server error caused by a NoSuchBeanException on 
> sessionFactory.
> To solve this problem I propose to add a new class in Spring cartridge 
> generated files : OpenSessionInViewFilterForAndromda, which extends Spring 
> OpenSessionInViewFilter and overrides lookupSessionFactory for taking our 
> particular structure into account (see attachment).
> Then the only thing the user would have to do is to change the class for 
> OpenSessionInViewFilter filter in web.xml and everything should work fine.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Andromda-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to