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

AbstractResource#getMountContentBaseBean() shouldn't cache mount base content bean

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • High
    • Resolution: Fixed
    • None
    • 2.24.01
    • None
    • None

    Description

      Currently, it caches the mount base content bean in the requestContext.
      This makes a problem when a JAX-RS resource updates a content and refreshes the jcr session in order to retrieve the content again by creating an HstQuery with the returned scopeBean from #getMountContentBaseBean().
      Here's a related stack traces:

      [INFO] [talledLocalContainer] 28.12.2011 14:39:14 WARN [org.hippoecm.hst.content.beans.query.HstCtxWhereClauseComputerImpl.getCtxWhereClause():237] Unable to get Context where clause: '{}'
      [INFO] [talledLocalContainer] javax.jcr.InvalidItemStateException: Item does not exist anymore: e9f6f957-f487-4628-9e6f-cda60f032223
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.ItemImpl.itemSanityCheck(ItemImpl.java:116)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:90)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.decorating.ItemDecorator.getPath(ItemDecorator.java:91)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.decorating.checked.ItemDecorator.getPath(ItemDecorator.java:92)
      [INFO] [talledLocalContainer] at org.hippoecm.hst.content.beans.query.HstCtxWhereClauseComputerImpl.getCtxWhereClause(HstCtxWhereClauseComputerImpl.java:189)
      [INFO] [talledLocalContainer] at org.hippoecm.hst.content.beans.query.HstCtxWhereClauseComputerImpl.getCtxWhereClause(HstCtxWhereClauseComputerImpl.java:255)
      [INFO] [talledLocalContainer] at org.hippoecm.hst.content.beans.query.filter.HstCtxWhereFilter.<init>(HstCtxWhereFilter.java:54)
      [INFO] [talledLocalContainer] at org.hippoecm.hst.content.beans.query.HstQueryImpl.getQueryAsString(HstQueryImpl.java:139)
      [INFO] [talledLocalContainer] at org.hippoecm.hst.content.beans.query.HstQueryImpl.getQuery(HstQueryImpl.java:234)
      [INFO] [talledLocalContainer] at org.hippoecm.hst.content.beans.query.HstQueryImpl.execute(HstQueryImpl.java:250)

      Because the (facet select) site content node (e.g., "/hst:hst/hst:sites/demo-preview/hst:content") doesn't have real node identifier but a virtual temporary identifier for the session, the scope bean must be re-queried after refreshing.
      So, we'd better not cache the scope bean at all.
      I don't think we need to cache the scope bean.

      BaseHstComponent#getSiteContentBaseBean() hasn't cached it.

      Attachments

        Activity

          People

            jsheriff Junaidh Kadhar Sheriff
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: