Cached GetLatestActivatedUsers

Vote:
 

Hello,

in the system we need to get the newest users in two different places. Also, the number of users to get differs. But it looks like the GetLatestActivatedUsers result is cached and every second time the function is used, the wrong number of users is returned.

Do I need to clear the cache (how do I find this cache key??) or is there a better way to solve this? Any help very appreciated!

Thank you

/ jonas

#22300
Aug 01, 2008 13:45
Vote:
 

Hi Jonas,

Thank you for your report. You are correct, there's an error causing the cache to incorrectly be considered valid for other values of the count parameter to GetLatestActivatedUsers. For force a cache invalidation of the value, you might call

CacheHandler.RemoveCachedObject("LatestActivatedUsers");

I'd recommend, for the time being, to call the method with the greatest number of users you want to retrieve in the application, and show only the number of users you want to show. This way, there is only one UserCollection instance kept in memory for the latest activated users.

/Kristoffer

#22744
Aug 14, 2008 10:49
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.