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

Object-Specific Caching Parameters

1 Answer 44 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
G. Deward
Top achievements
Rank 1
G. Deward asked on 20 Jul 2012, 08:40 PM
Is it possible to set specific rules (max objects, etc.) for each object type in the model?  There are some objects that are much less likely to ever be updated than others?

Also, are there other settings available for the second level cache other than the number of objects and query results to cache?  Maybe the length of time which an object should be retained?

Thanks, in advance.

- G. Deward

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 25 Jul 2012, 08:19 AM
Hello Greg,

 You can specify the 'Cache Policy' for each persistent type to control whether and how the instance of this type are cached. This can be done by selecting the class on the designer surface, pressing F4 to get the property window for this class and specifying the property value there.  Note that this setting applies to only the second level cache. All objects will always be cached in the first level cache.

The only property you can set on the second level cache is the number of objects per query result. The 'SecondLevelCacheConfiguration' type defines the properties that can be specified.
The second level cache uses the 'Least Recently Used' algorithm to evict instances when the cache is full ie the oldest objects are evicted first.

Hope this helps. Do get back in case you need further assistance.

Kind regards,
Ady
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
Getting Started
Asked by
G. Deward
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or