Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-17341

Every documents loaded from the cache store should have the cache store as internal store

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Solved By
    • Affects Version/s: 12.3, 11.10.5
    • Fix Version/s: None
    • Component/s: Old Core
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Apparently using $xwiki.getDocument in a script use by default the cache store, but the retrieved document internally have the hibernate store. This might lead to inconsistencies on the cache store since it's not correctly invalidated when performing refactoring operations.

      Reproduction steps:

      • Create a document Test.WebHome
      • Execute the following script:
        {{velocity}}
        #set($oldRef = "Test.WebHome")
        #set($newRef = "Target.WebHome")
        #set($oldDoc = $xwiki.getDocument($oldRef))
        #set($targetDoc = $xwiki.getDocument($newRef))
        Old doc: Is new? $oldDoc.isNew() Store: $oldDoc.getDocument().store.getClass()
        Target doc: Is new? $targetDoc.isNew() Store: $targetDoc.getDocument().store.getClass()
        
        XWiki Store: $xwiki.getXWiki().getStore().getClass()
        {{/velocity}}
        

      Expected result:

      • Everywhere the store class is displayed, it should be CacheStore

      Obtained result:

      • The HibernateStore is displayed for the document, but the XWiki Store is the CacheStore.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                surli Simon Urli
                Reporter:
                surli Simon Urli
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: