Uploaded image for project: 'Magnolia Groovy Module'
  1. Magnolia Groovy Module
  2. MGNLGROOVY-32

Inconsistent session returned when getting a QueryManager

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.1
    • 1.1
    • console, integration
    • None

      In the console, if one tries to obtain a QueryManager instance via a HierarchyManager, it's provided with the correct jcr session:

      mgnl> q = ctx.getHierarchyManager('config').getQueryManager()
      ===> 
      info.magnolia.cms.core.search.QueryManagerImpl@1ee3b2dd
      mgnl> q.createQuery("select * from nt:base where contains(*, 'forum-jcr')", "sql")
      ===> 
      info.magnolia.cms.core.search.QueryImpl@343b8714
      

      ... but if she tries to take the MgnlContext.getQueryManager() shortcut, it isn't:

      mgnl> q = ctx.getQueryManager('config')
      info.magnolia.cms.core.search.QueryManagerImpl@734a8075
      mgnl> q.createQuery("select * from nt:base where contains(*, 'forum-jcr')", "sql")
      RepositoryException: corresponding session has been closed
      

        Acceptance criteria

              fgrilli Federico Grilli
              gjoseph Magnolia International
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD