Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-9303

Caching is not enabled by default for the hibernate repository

      Since we have moved Confluence 2.5.x to use the latest atlassian-user where the hibernate repo is no wired up with caching managers, we need to make sure we set the flag cache="true" explicitly in atlassian-user.xml (and make that the shipped default).

            [CONFSERVER-9303] Caching is not enabled by default for the hibernate repository

            Just a note for anyone doing this that you might run into this issue (wanted to note it here in case anyone beats their head against it for a while like I did).

            http://jira.atlassian.com/browse/CONF-9434

            Andrew Miller added a comment - Just a note for anyone doing this that you might run into this issue (wanted to note it here in case anyone beats their head against it for a while like I did). http://jira.atlassian.com/browse/CONF-9434

            Very clear – thanks much for the explanation. We are using some "local" Confluence groups as well as LDAP groups so would definitely apply for us (even beyond all the regular permissions checks).

            This might also explain some speed issues we'd seen with the children macro going multiple levels down (querying lots of pages).

            Andrew Miller added a comment - Very clear – thanks much for the explanation. We are using some "local" Confluence groups as well as LDAP groups so would definitely apply for us (even beyond all the regular permissions checks). This might also explain some speed issues we'd seen with the children macro going multiple levels down (querying lots of pages).

            Matt Ryall added a comment -

            The caching which was disabled was the cache of groups stored in Confluence, not LDAP groups. However, the Hibernate repository configuration which had this problem is only used when either LDAP has been enabled or you have followed the 'Improve User Search Performance' guide above.

            Even though the cache is only for Confluence groups (not LDAP groups), all permission checks would be slower because every group membership query would result in accessing the database in each new request. If you are running Confluence 2.5.6, and either have LDAP enabled or have followed the 'Improve User Search Performance' guide, you should apply this fix or upgrade to Confluence 2.5.7.

            Please let me know if you need any more clarification. I'm happy to describe further how this works, because it is useful information for many people.

            Matt Ryall added a comment - The caching which was disabled was the cache of groups stored in Confluence, not LDAP groups. However, the Hibernate repository configuration which had this problem is only used when either LDAP has been enabled or you have followed the 'Improve User Search Performance' guide above. Even though the cache is only for Confluence groups (not LDAP groups), all permission checks would be slower because every group membership query would result in accessing the database in each new request. If you are running Confluence 2.5.6, and either have LDAP enabled or have followed the 'Improve User Search Performance' guide, you should apply this fix or upgrade to Confluence 2.5.7. Please let me know if you need any more clarification. I'm happy to describe further how this works, because it is useful information for many people.

            And....to make sure I'm understanding correctly....

            Is it correct to say that this would not affect caching for LDAP-based users and groups? Or is that the primary point? (Given the size of our user base, I'm very interested in making sure I understand caching-related issues.)

            Thanks.

            Andrew Miller added a comment - And....to make sure I'm understanding correctly.... Is it correct to say that this would not affect caching for LDAP-based users and groups? Or is that the primary point? (Given the size of our user base, I'm very interested in making sure I understand caching-related issues.) Thanks.

            This issue only exists in Confluence 2.5.6, because the atlassian-user library was upgraded. In earlier versions, the caching was hard-coded for the Hibernate repository.

            Thanks for the tip on the documentation. I've fixed the atlassian-user.xml on that page.

            Matt Ryall added a comment - This issue only exists in Confluence 2.5.6, because the atlassian-user library was upgraded. In earlier versions, the caching was hard-coded for the Hibernate repository. Thanks for the tip on the documentation. I've fixed the atlassian-user.xml on that page.

            Would cache="true" also fix this issue in previous versions of Confluence 2.5.x (pre 2.5.7?)

            Also, this page needs to be updated (I've been adding comments) to indicate changes in atlassian-user.xml:

            http://confluence.atlassian.com/display/DOC/How+to+Improve+User+Search+Performance

            Gary Weaver added a comment - Would cache="true" also fix this issue in previous versions of Confluence 2.5.x (pre 2.5.7?) Also, this page needs to be updated (I've been adding comments) to indicate changes in atlassian-user.xml: http://confluence.atlassian.com/display/DOC/How+to+Improve+User+Search+Performance

            Will do – thanks for the quick response.

            Andrew Miller added a comment - Will do – thanks for the quick response.

            This change should have absolutely no effect on the page tree or any other macro in Confluence. Please raise a support request so we can investigate your problem further. In particular, please attach your logs to the case.

            Matt Ryall added a comment - This change should have absolutely no effect on the page tree or any other macro in Confluence. Please raise a support request so we can investigate your problem further. In particular, please attach your logs to the case.

            Have you had any reports of this change breaking the page tree display?

            After adjust that line in atlassian-user.xml and restarting Confluence, I found that some but not all page trees were broken (both the pagetree macro and the pagetree under Browse Space).

            I can supply more details if needed (but didn't want to include a ton here if not needed).

            Andrew Miller added a comment - Have you had any reports of this change breaking the page tree display? After adjust that line in atlassian-user.xml and restarting Confluence, I found that some but not all page trees were broken (both the pagetree macro and the pagetree under Browse Space). I can supply more details if needed (but didn't want to include a ton here if not needed).

            Matt Ryall added a comment -

            This has been updated in the commented out sections in the atlassian-user.xml config file.

            Matt Ryall added a comment - This has been updated in the commented out sections in the atlassian-user.xml config file.

              Unassigned Unassigned
              dave@atlassian.com dave (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: