This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
According to this page, if I have a class where I don't want collection references to huges amounts of data, I can delete the collection name from an association to make it one-way, but then the class has to be marked as cached: http://www.mindscapehq.com/documentation/lightspeed/Domain-Modelling-Techniques/Reference-Data-and-Lookups But it is unclear to me what the effect of setting the entity Cached field to true actually does? A classic example in my model is our Employee class, where I don't want it to maintain collections of all orders checked by that employee for instance. So I have to mark the Employee class as cached, and then I can remove the other end of the association as necessary. But what does that mean to the handling of the entities when they are loaded? Cleary the Employee class is good candidate for reference data because it does not change very often, but it does change. It can change when a new employee is added, or it can change if an employee changes their password. So how does caching effect this, and if an entity is cached and it is updated, what happens then? Also, does this only affect the caching if you are using the 2nd level cache, or does it affect caching of values even without the 2nd level cache? |
|
|
Hi Kendall, I think this blog post: http://www.mindscapehq.com/blog/index.php/2009/11/05/whats-the-deal-with-lightspeed-caching/ should answer most of your questions. When you insert, update or delete an entity (and save the changes), the cached copy is updated. However, if you have multiple machines or multiple processes then it is up to the cache to propagate this across multiple machines. I believe MemcachedCache can do this but the default cache cannot. So if you are using the default cache and have multiple servers then other servers could continue working with stale data for up to the cache expiry period. |
|
|
Ok thanks, so basically enabling or disabling the caching of entities in the designer really only affects the 2nd level cache, and any entities that are not enabled for explicit caching won't get cached in the 2nd level cache? So by default, no entities would be cached in the 2nd level cache until you change the cache setting in the model explicity? |
|
|
Also what is the value of the Cache Expiry value? Is it is second or minutes? |
|
|
Minutes. A handy tip for some of these 'terse' property names is that we often provide a bit more info in the description panel at the bottom of the Properties window, which Visual Studio often helpfully collapses so you can't see it. See the attached screenshot. |
|
|
Yes, your description of the second level cache is correct. You have to explicitly opt each entity type into the second level cache. |
|
|
Thanks for the tip! I never noticed that. |
|