locked
DataCache.GetIfNewer and expiration RRS feed

  • Question

  • Hi,
    I use Azure AppFabric Cache and came to the following issue.

    First, I get my object from cache using DataCache.Get() method. I also get DataCacheItemVersion object that I then use for querying for new version of data using DataCache.GetIfNewer().

    The problem is that the method DataCache.GetIfNewer() does not detect expiration of the cached object. Using GetIfNewer(), it behaves like there is still the same value in the cache. But if the object expires, the value is reset to null, so it actually has changed. I would expect that the value of DataCacheItemVersion (which is passed in as reference) would change.

    Is that bug? Or is there better way how to get updated values from cache?

    Thanks!


    eXavier
    Tuesday, November 1, 2011 12:22 PM

Answers

  • Hi,

    After I investigating on this issue I get that when we make the GetIfNewer() call and if item is not there in the cache , API will return NULL and version won’t get updated as Read is not success. Therefore, we take it as by design.

     

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Wednesday, November 9, 2011 8:32 AM

All replies

  • Hello eXavier, 

    Thank you for your post.

    This is a quick note to let you know that I am performing investigate on this issue and will get back to you as soon as possible.

    I appreciate your patience.

     

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Wednesday, November 2, 2011 10:44 AM
  • Hi,

    After I investigating on this issue I get that when we make the GetIfNewer() call and if item is not there in the cache , API will return NULL and version won’t get updated as Read is not success. Therefore, we take it as by design.

     

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Wednesday, November 9, 2011 8:32 AM
  • Hi Ming Xu,

    Thanks for investigation but it is really bad news for me. I consider it as poor design decision as the value has changed no matter if it expired, has been deleted or just because Azure AppFabric Cache spontaneously reseted, which happens occasionally.

    It actually makes the method GetIfNewer() useless in most of cases because it does not cover all possibilities :-(

    I reported it here https://connect.microsoft.com/netservices/feedback/details/707928/datacache-getifnewer-cant-detect-deleted-values

    eXavier


    eXavier
    Wednesday, November 23, 2011 7:24 PM