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
|
Hi, I am caching a table of (mostly) reference data with 2nd level FindAll caching enabled. When updating one of those entities (loaded by FindById), the cache does not seem to get updated. Is this expected or am I missing something? Are cached entities only updated, if they are not cached via FindAll? Thanks, Markus |
|
|
Hi Markus, Yes thats correct, the FindAll cache is distinct from the single entity cache. When initially loading the reference data an entry is set for the full set and then each entry in that set is also cached for FindById. If you make a subsequent change to the entity which is being held by Id however then this would differ from the version of that entity that would be returned from the full set. Edit: See the follow-up below, as updating an existing entity causes an expiry of the cached collection result
|
|
|
ok, any workaround suggestions on how to update the FindAll cache then, when updating single entities? Simply reloading FindAll? |
|
|
Generally speaking reloading FindAll would just return the same cached result. Ive done some checking as to when we would forcibly expire any cached result and it appears the FindAll cached result should be expired when an update or delete is made or a new entity of that type is added, so if you make an update to a cached entity then reloading FindAll should trigger a new database fetch and return the updated collection.
|
|