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 have a table where I want to cache the results of a lookup on a field which is not an entity Id. e.g. a table of Regions which have an Guid entity ID & lookup via an ISO 3166-2 2 digit country code. The baked in cache features of LS appear to only work with the entity id field (which is a reasonable assumption as it ensure uniqueness etc.) If I cache the results of a lookup in something like the Appfabric cache what would be the prefered way of attaching (choice of wording was intentional) the retrieved records to a unit of work so that LS plays nice with them. Bryn |
|
|
Yep thats right, we cache entities by Id so our support for 2nd level caching extends what is already occuring in the IdentityMap (1st level cache). How are you intending to use the cached entities later on? The primary issue you will be concerned about is concurrency so if you are intending to use the entities in a writable fashion you should always load fresh copies into the UnitOfWork where those modifications are being performed (you then may want to refresh the cache following a flush). Another common issue you can run into is lazy loaded associations where you will need the entity attached to a UnitOfWork to handle any database calls.
|
|