Announcement Announcement Module
No announcement yet.
Change my webapp with OpenEntityManagerInViewFilter? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change my webapp with OpenEntityManagerInViewFilter?

    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:
    	<!-- Include this if you are using Hibernate -->
    	<!-- Spring config -->
    Now that my app runs fine again (so I assume spring was configured properly), I still have the Lazy problem:

     [javax.enterprise.resource.webcontainer.jsf.context] (http-- 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.

  • #2
    What you have explicitly configured are already the defaults so not sure why you added them.

    Please use [ code][/code ] tags when posting code also you are trying to use Spring Managed beans in a JSF environment that might be troublesome (I suggest a read of the reference guide especially the JSF section). Also make sure that you aren't opening sessions yourself and that spring is in control of the transactions (or at least knows about them).