Results 1 to 1 of 1

Thread: lazy loading issue with JPA

  1. #1

    Question lazy loading issue with JPA

    Hi All,

    I am using JPA with Springs i had some problem.

    this is my web.xml

    <filter>
    <filter-name>lazyLoadingFilter</filter-name>
    <filter-class>
    org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter
    </filter-class>
    </filter>
    <filter-mapping>
    <filter-name>lazyLoadingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListe ner
    </listener-class>
    </listener>


    --------------
    in app.xml

    <bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalEntityMana gerFactoryBean">
    <property name="persistenceUnitName"
    value="testing" />
    </bean>


    ------------
    But when i run the app i got

    No bean named 'entityManagerFactory' is defined

    if i disable lazyLoadingFilter in web.xml i.e i remove the below code
    --
    <filter>
    <filter-name>lazyLoadingFilter</filter-name>
    <filter-class>
    org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter
    </filter-class>
    </filter>
    <filter-mapping>
    <filter-name>lazyLoadingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

    ------------
    then it runs fine
    But i need lazyloading
    Last edited by gaddamsandeeps; Apr 27th, 2009 at 05:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •