This is a migrated thread and some comments may be shown as answers.

IsCached ?

1 Answer 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shawn Krivjansky
Top achievements
Rank 1
Shawn Krivjansky asked on 19 Oct 2011, 09:40 PM
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...

1 Answer, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 20 Oct 2011, 05:07 PM
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!

Tags
General Discussions
Asked by
Shawn Krivjansky
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or