This question is locked. New answers and comments are not allowed.
Hi all,
I have a situation where I'm loading data into the database for each record I have to lookup ID's that are related to that record.
What I have noticed is that the table holding the ID's gets queried for every record loaded, there are much fewer IDs than records to be loaded so I expected the cache mechanics to kick in so there would be less queries to the lookup table.
Am I experiencing the same as described last in this thread http://www.telerik.com/community/forums/orm/general-discussions/l2-cache-not-working.aspx, that since there are more than 500 records/items in the lookup table it's not cached ?.
Since I only need the ID but not the OA object could I change the function that gets the ID so it would be more efficent ?
it looks something like this
Thanks in advance.
I have a situation where I'm loading data into the database for each record I have to lookup ID's that are related to that record.
What I have noticed is that the table holding the ID's gets queried for every record loaded, there are much fewer IDs than records to be loaded so I expected the cache mechanics to kick in so there would be less queries to the lookup table.
Am I experiencing the same as described last in this thread http://www.telerik.com/community/forums/orm/general-discussions/l2-cache-not-working.aspx, that since there are more than 500 records/items in the lookup table it's not cached ?.
Since I only need the ID but not the OA object could I change the function that gets the ID so it would be more efficent ?
it looks something like this
public bool TryFindID(short type, string externalID, out int ID) { Lookup dim= this.Lookup.FirstOrDefault(d => string.Equals(d.Source_Id, externalID) && short.Equals(d.type, type)); if (dim != null) { ID = dim.Id; return true; } else { ID = int.MinValue; return false; } }Thanks in advance.