IsCached ?

2 posts, 0 answers
  1. Shawn Krivjansky
    Shawn Krivjansky avatar
    86 posts
    Member since:
    Jan 2010

    Posted 19 Oct 2011 Link to this post

    Using newer DOMAIN context...

    I can't find much information on "IsCached" and the actual functional use of it as it relates to Persistent Object L2 cache status, but a bit of an interesting question here... 

    If you want to check the "IsCache" status of an object, but you don't yet know the ObjectKey (and don't know the primary key), is there ANY way to actually use this method?

    For example, I might have a record in a table that I find based on some other marker:
    dim oMyObject as MyObject = context.MyObjects.Where(Function(db) db.MyMarker = True).FirstOrDefault

    Now, having done that operation... Yes, I can get the ObjectKey and call the "IsCached" method.  But, the fact that I just read the record means that it will of course be in L2 cache (assuming everything is turned on to support L2 cache)... so, there is no real need to check "IsCached" because I know it is already there.

    So, is the ONLY way to use this in a useful way to have stored the ObjectKey (in Session or similar place) and retrieved and checked at a later time using that previously stored ObjectKey??

    Just trying to make sure I'm not missing something here...

  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 20 Oct 2011 Link to this post

    Hello Shawn Krivjansky,
    The main reason for this call was to make the cache better testable from outside. Looks like it makes no sense for you to use it.

    Greetings,
    Jan Blessenohl
    the Telerik team

    NEW and UPDATED OpenAccess ORM Resources. Check them out!

  3. DevCraft banner
Back to Top