Hi guys,
I have a little already working JBoss webapp, and a Lazy initialisation problem.
Therefore I was advised to investigate in Spring and use OpenEntityManagerInViewFilter.
Nevertheless I still get the error, hope you could help me?
I set it up like this:
Now that my app runs fine again (so I assume spring was configured properly), I still have the Lazy problem:Code:<filter> <filter-name> OpenEntityManagerInViewFilter </filter-name> <filter-class> org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter </filter-class> <init-param> <param-name>singleSession</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>flushMode</param-name> <param-value>AUTO</param-value> </init-param> </filter> <!-- Include this if you are using Hibernate --> <filter-mapping> <filter-name>OpenEntityManagerInViewFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- Spring config --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener>
Code:[javax.enterprise.resource.webcontainer.jsf.context] (http--127.0.0.1-8080-1) org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: domain.personList, no session or session was closed
What else do I have to change in my app to make use of the Spring OEM Filter?
My setup is like this:
@Entity Customer;
@Stateless @TransactionAttribute(TransactionAttributeType.REQ UIRES_NEW) DaoService;
@Named @RequestScoped CustomerFacade;
+jsf stuff.


Reply With Quote