Fixed
Details
Priority
CriticalFix versions
Components
Assignee
Robert LongRobert LongReporter
Aaron ZeckoskiAaron Zeckoski(Deactivated)Labels
Details
Details
Priority
Fix versions
Components
Assignee
Robert Long
Robert LongReporter
Aaron Zeckoski
Aaron Zeckoski(Deactivated)Labels
Created April 23, 2014 at 6:57 AM
Updated April 25, 2018 at 3:19 PM
Resolved January 5, 2015 at 6:37 AM
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);
}