Object-Specific Caching Parameters

2 posts, 0 answers
  1. G. Deward
    G. Deward avatar
    9 posts
    Member since:
    Jan 2012

    Posted 20 Jul 2012 Link to this post

    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
  2. Ady
    Admin
    Ady avatar
    589 posts

    Posted 25 Jul 2012 Link to this post

    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.
  3. DevCraft banner
Back to Top