C
cat
We recently moved an older ASP.NET 1.1 code base on to ASP.NET 2.0, .NET 3.0
and Windows 2003 Server SP2. We started experiencing the following issue with
the web cache (the code is straightforward and worked flawlessy before the
upgrade):
Dim o As Object = Cache.Get(key)
If o Is Nothing Then
Cache.Insert(key, GetTheData())
o = Cache.Get(key)
End If
Randomly, Cache.Get(key) returns nothing, even after the application has
been up for a while. Then the Cache.Insert kicks in. Only that the call to
Insert fails with no error and no exception. The subsequent Cache.Get(key)
returns nothing. I've tried to set up the expiration to some remote date in
the future and the sliding expiration; still nothing. I tried something like
this;
Cache.Insert(key, GetTheData(), Nothing,
DateTime.Parse("1/1/9999"),Cache.NoSlidingExpiration)
and
Cache.Insert(key, GetTheData(), Nothing, Cache.NoAbsoluteExpiration,
TimeSpan.FromDays(365))
I even added after the first failed Insert a Thread.Sleep(20) the tried the
Insert again. Didn't work either.
I searched on the Internet and I found a few other posts describing a
similar issue. Yet no reply to any of them so it seems that there is not much
knowledge about this strange issue.
Any idea is highly appreciated.
Thanks,
cat
and Windows 2003 Server SP2. We started experiencing the following issue with
the web cache (the code is straightforward and worked flawlessy before the
upgrade):
Dim o As Object = Cache.Get(key)
If o Is Nothing Then
Cache.Insert(key, GetTheData())
o = Cache.Get(key)
End If
Randomly, Cache.Get(key) returns nothing, even after the application has
been up for a while. Then the Cache.Insert kicks in. Only that the call to
Insert fails with no error and no exception. The subsequent Cache.Get(key)
returns nothing. I've tried to set up the expiration to some remote date in
the future and the sliding expiration; still nothing. I tried something like
this;
Cache.Insert(key, GetTheData(), Nothing,
DateTime.Parse("1/1/9999"),Cache.NoSlidingExpiration)
and
Cache.Insert(key, GetTheData(), Nothing, Cache.NoAbsoluteExpiration,
TimeSpan.FromDays(365))
I even added after the first failed Insert a Thread.Sleep(20) the tried the
Insert again. Didn't work either.
I searched on the Internet and I found a few other posts describing a
similar issue. Yet no reply to any of them so it seems that there is not much
knowledge about this strange issue.
Any idea is highly appreciated.
Thanks,
cat