Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-2943

All entities being loaded when only one requested

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.5.RELEASE
    • Fix Version/s: None
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      Steps to reproduce:

      1. Create a new project using the pet clinic script
      2. Set logging to debug
      3. Run the application and enter on owner and a multiple number of associated pets
      4. call /pets/1
      5. The logs will show that all instances of Pet are queried

      e.g.

      DEBUG org.hibernate.SQL - select pet0_.id as id2_, pet0_.name as name2_, pet0_.owner as owner2_, pet0_.send_reminders as send3_2_, pet0_.type as type2_, pet0_.version as version2_, pet0_.weight as weight2_ from pet pet0_
      DEBUG org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
      DEBUG org.hibernate.loader.Loader - result row: EntityKey[com.springsource.petclinic.domain.Pet#1]
      DEBUG org.springframework.beans.factory.annotation.InjectionMetadata - Processing injected method of bean 'com.springsource.petclinic.domain.Pet': PersistenceElement for transient javax.persistence.EntityManager com.springsource.petclinic.domain.Pet.entityManager
      DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'entityManagerFactory'
      DEBUG org.hibernate.loader.Loader - result row: EntityKey[com.springsource.petclinic.domain.Pet#2]
      DEBUG org.springframework.beans.factory.annotation.InjectionMetadata - Processing injected method of bean 'com.springsource.petclinic.domain.Pet': PersistenceElement for transient javax.persistence.EntityManager com.springsource.petclinic.domain.Pet.entityManager
      DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'entityManagerFactory'
      DEBUG org.hibernate.loader.Loader - result row: EntityKey[com.springsource.petclinic.domain.Pet#3]
      DEBUG org.springframework.beans.factory.annotation.InjectionMetadata - Processing injected method of bean 'com.springsource.petclinic.domain.Pet': PersistenceElement for transient javax.persistence.EntityManager com.springsource.petclinic.domain.Pet.entityManager
      DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'entityManagerFactory'

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              arjunsol Nick Shaw
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: