Last post Dec 03, 2011 01:19 PM by jirhi
Dec 03, 2011 01:19 PM|jirhi|LINK
I have following problem: When I deploy dll of my application, database is overloaded with qeuries. I assume that there is some queue for incoming requests and while new dll is being loded, requests are queued. When dll is ready, requests are processed.
I store many database results to cache in web application. The problem is, that some data, which should be read only once from DB and next time from cache, is stored to the cache 10 and more times (that means data was read 10 and more times from db). I tried
to solve like this:
object o = MyCache.GetDataWithWait("key");
if(o == null)
// Read data from DB and store it to the cache with "key"
public static object GetDataWithWait(string key)
Cache mycache = System.Web.HttpContext.Current.Cache;
object o = mycache[key];
if (o == null)
object wait = mycache["key-wait"];
if (wait != null && Convert.ToBoolean(wait))
o = mycache[key];
but it doesn't seem to be working, object is still stored to cache more than once. Any ideas?