November Happy Hour will be moved to Thursday December 5th.

Topic attributes caching

Vote:
 

Hi There,


I'm working on a Relate+ site and making use of the custom attributes that are available on the community objects, specifically on the Topic object.

I have some functionality where it is possible to move a Topic from one club to another and when doing this I change the value of one of the attributes (create a clone of the original, set the values then call the UpdateTopic method using the ForumHandler). I can step through this and see the value of the attribute being changed and that it is the same once the UpdateTopic method is called.

However when I load the page that would contain the moved topic I see that the attribute value has not been changed as if it's being cached. When restarting the web app the topic has the correct attribute value so it seems the cache is updated.

I have tried using the RemoveCachedObject method using the CacheHandler in the hope that this will force a refresh but this makes no difference.

Has anyone else experienced this and know how to resolve?

Thanks in advance,

Mark

#58265
Apr 16, 2012 17:52
Vote:
 

Hello,


Well I finally worked this out, and after much frustration, I found two things that caused this.

Firstly, the code was doing the following

  • Create clone
  • update attribute value
  • call the UpdateTopic method
  • update more attribute values
  • call the UpdateTopic method

and removing the first call to UpdateTopic meant that all values were saved and updated in the cache as required.

I deduce from this (incorrectly maybe) that the first UpdateTopic updates the cache and prevents it being updated in the second call to UpdateTopic (which does actually update the underlying data just not the cache).

I'm not sure which is more ridiculous, the unneccessary first call to UpdateTopic or the fact that the cache is not updated each time this is called.

I hope this helps someone out in the future!

Mark

#58282
Apr 17, 2012 16:03
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.