Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-38993

User caching happens in threadlocal as well as cache

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.9.x, 10.0
    • Fix Version/s: 11.0
    • Component/s: Kernel
    • Previous Issue Keys:
      KNL-1241

      Description

      User data is cached in both threadlocal and the callCache cache. It really should only be cached in the cache. Use of threadlocals for caching is a bad idea and should no longer be done. This is especially interesting because the threadlocal can win over the cache so if the cache is updated or expired so that the user data would be valid, the threadlocal version would still be used (which may be stale).

      protected UserEdit getCachedUser(String ref)
      {
      UserEdit user = (UserEdit)threadLocalManager().get(ref);
      if ((user == null) && (m_callCache != null))

      { user = (UserEdit)m_callCache.get(ref); }

      return user;
      }

      protected void putCachedUser(String ref, UserEdit user)

      { threadLocalManager().set(ref, user); if (m_callCache != null) m_callCache.put(ref, user); }

      protected void removeCachedUser(String ref)

      { threadLocalManager().set(ref, null); if (m_callCache != null) m_callCache.remove(ref); }

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                • Assignee:
                  relong Bob Long
                  Reporter:
                  aaronz Aaron Zeckoski (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Integration