net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed

Atlassian JIRA | Gurleen Anand [Atlassian] | 10 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Enabling caching for hibernate repository by adding the *cache="true"* directive in the atlassian-user.xml file, such as this: {noformat} <hibernate name="Hibernate Repository" key="hibernateRepository" description="Hibernate Repository" cache="true" /> {noformat} leads to the following exception: {noformat} Cause: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) Stack Trace: [hide] net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Set.contains(Set.java:122) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasExternalMembership(HibernateGroupManager.java:461) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasMembership(HibernateGroupManager.java:437) at com.atlassian.user.impl.cache.CachingGroupManager.hasMembership(CachingGroupManager.java:149) at com.atlassian.user.impl.delegation.DelegatingGroupManagerTemplate.hasMembership(DelegatingGroupManagerTemplate.java:189) {noformat}

    Atlassian JIRA | 10 years ago | Gurleen Anand [Atlassian]
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed
  2. 0

    Enabling caching for hibernate repository by adding the *cache="true"* directive in the atlassian-user.xml file, such as this: {noformat} <hibernate name="Hibernate Repository" key="hibernateRepository" description="Hibernate Repository" cache="true" /> {noformat} leads to the following exception: {noformat} Cause: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) Stack Trace: [hide] net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Set.contains(Set.java:122) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasExternalMembership(HibernateGroupManager.java:461) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasMembership(HibernateGroupManager.java:437) at com.atlassian.user.impl.cache.CachingGroupManager.hasMembership(CachingGroupManager.java:149) at com.atlassian.user.impl.delegation.DelegatingGroupManagerTemplate.hasMembership(DelegatingGroupManagerTemplate.java:189) {noformat}

    Atlassian JIRA | 10 years ago | Gurleen Anand [Atlassian]
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed

    Root Cause Analysis

    1. net.sf.hibernate.LazyInitializationException

      Failed to lazily initialize a collection - no session or session was closed

      at net.sf.hibernate.collection.PersistentCollection.initialize()
    2. net.sf.hibernate
      Set.contains
      1. net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209)
      2. net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
      3. net.sf.hibernate.collection.Set.contains(Set.java:122)
      3 frames
    3. com.atlassian.user
      DelegatingGroupManagerTemplate.hasMembership
      1. com.atlassian.user.impl.hibernate.HibernateGroupManager.hasExternalMembership(HibernateGroupManager.java:461)
      2. com.atlassian.user.impl.hibernate.HibernateGroupManager.hasMembership(HibernateGroupManager.java:437)
      3. com.atlassian.user.impl.cache.CachingGroupManager.hasMembership(CachingGroupManager.java:149)
      4. com.atlassian.user.impl.delegation.DelegatingGroupManagerTemplate.hasMembership(DelegatingGroupManagerTemplate.java:189)
      4 frames