Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-3853

JcrHippoRepository can invoke HippoRepositoryFactory.getHippoRepository() concurrently which makes unit tests fail

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 4.2.0
    • None
    • None
    • Platform Sprint 142

    Description

      In org.hippoecm.hst.core.jcr.pool.JcrHippoRepository#initHippoRepository, when the repositoryURI is empty (in unit tests the case), the code

      if (StringUtils.isEmpty(repositoryURI)) {
                          hippoRepository = HippoRepositoryFactory.getHippoRepository();
                      }
      

      throws an exception when another thread already invoked

      HippoRepositoryFactory.getHippoRepository()
      

      before. This can happen because there is the pooling repositories that trigger org.hippoecm.hst.core.jcr.pool.JcrHippoRepository#initHippoRepository (for example from hst event listeners) but also the 'delegating' repository triggers org.hippoecm.hst.core.jcr.pool.JcrHippoRepository#initHippoRepository : However, the delegating repositories (id="javax.jcr.Repository.delegating") use a different backing JcrHippoRepository instance than the pooling repositories.

      Attachments

        Activity

          People

            Unassigned Unassigned
            aschrijvers Ard Schrijvers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: