Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-9434

Enabling Caching for Hibernate Repository causes net.sf.hibernate.LazyInitializationException error

    XMLWordPrintable

Details

    Description

      Enabling caching for hibernate repository by adding the cache="true" directive in the atlassian-user.xml file, such as this:

      <hibernate name="Hibernate Repository" key="hibernateRepository"  description="Hibernate Repository" cache="true" />
      

      leads to the following exception:

       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)
      

      Attachments

        Issue Links

          Activity

            People

              matt@atlassian.com Matt Ryall
              ganand Gurleen Anand [Atlassian]
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: