SqlCacheDependency works for a couple of minutes

Y

Yosi

Hi,

I have a wierd problem about the SqlCacheDependency class. It just
works for a couple of minutes. After 2 minutes or more, the cache does
not expire anymore. I'm using SQL Server 2005 as database.

Here is the code:

private string getTime()

{

string time = (string)Cache["KEY"];

if (time == null)

{


SqlConnection sqlConnection = new
SqlConnection(@"Server=BIZYUSUF\SQL2005;Database=Deneme2;User
Id=sa;Password=;");

SqlCommand command = new SqlCommand(@"select KOLON1 from
dbo.CACHE_DENEME3", sqlConnection);

sqlConnection.Open();


SqlCacheDependency dependency = new SqlCacheDependency(command);


time = System.DateTime.Now.ToString();

Cache.Insert("KEY", time, dependency);

command.ExecuteReader();

sqlConnection.Close();

}

return time;

}


When there is no activity for 2-3 minutes , the cache does not expire
anymore. Even that I insert a record to the CACHE_DENEME3 table, the
page reads from the cache.
Am I the only person, encountering this issue ?
 
G

Guest

Yosi said:
I have a wierd problem about the SqlCacheDependency class. It just
works for a couple of minutes. After 2 minutes or more, the cache does
not expire anymore. I'm using SQL Server 2005 as database.

When there is no activity for 2-3 minutes , the cache does not expire
anymore. Even that I insert a record to the CACHE_DENEME3 table, the
page reads from the cache.
Am I the only person, encountering this issue ?

Yosi,

Microsoft has release a hotfix that addresses this problem:

http://support.microsoft.com/kb/913364/EN-US/

====================
Duncan Smith [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top