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

Inconsistent session returned when getting a QueryManager

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1.1
    • Component/s: console, integration
    • Labels:
      None
    • Magnolia Release:
      4.4.2

      Description

      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
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: