struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mounir Benzid ...@meetingmasters.de>
Subject Open session in view (JPA, struts2, Spring 3, Hibernate4)
Date Thu, 26 Jul 2012 09:44:54 GMT
Because of a "limitation" (which is rather a bug) of Hibernate 4, I need 
to switch to an open-session-in-view pattern in struts2


I was hoping that setting the right spring configuration in my web.xml 
would do the trick (see below)

The session still dies before the view layer (ognl) has any chance to 
lazy fetch from the database.

Is there anything struts-specific to make OSIV work?


I use Spring 3 and the EntityManager is from my JPA provider (hibernate).

- Mounir



   <filter>
<filter-name>OpenEntityManagerInViewFilter</filter-name>
         <filter-class>
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
         </filter-class>
         <init-param>
<param-name>entityManagerFactory</param-name>
<param-value>entityManagerFactory</param-value>
         </init-param>
     </filter>
     <filter-mapping>
<filter-name>OpenEntityManagerInViewFilter</filter-name>
         <url-pattern>/public/*</url-pattern>
     </filter-mapping>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message