Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SqlCacheDependency - Cache Invalidation wihout result set ..

 
   Database Help (Home) -> Notification Services RSS
Next:  Variable in SMTP Protocol  
Author Message
mrashidsaleem

External


Since: Jan 08, 2007
Posts: 2



(Msg. 1) Posted: Mon Jan 08, 2007 4:02 am
Post subject: SqlCacheDependency - Cache Invalidation wihout result set modification
Archived from groups: microsoft>public>sqlserver>programming, others (more info?)

Using the SQL 2005 "query notification" caching mechanism, I am caching
three columns (UserId, UserName, Password) of a table called UserInfo
in my web application cache. However, the cache gets invalidated (and
needs to be re-loaded) when another column LastUpdateDateTime of the
same table gets modified. This is NOT as per my expectation. Following
is what MSDN says about Query Notifications in SQL2005
(http://msdn2.microsoft.com/en-us/library/ms178604(VS.80).aspx).

"SQL Server 2005 cache dependency is more flexible in the types of
changes that receive notification. SQL Server 2005 monitors changes to
the result set of a particular SQL command. If a change occurs in the
database that would modify the results set of that command, the
dependency causes the cached item to be invalidated. This allows SQL
Server 2005 to provide row-level notification."

This means, regardless of updates done to the table, as long as the
result set of the query is not modified (that is, produces the same
result), the cache should not be invalidated. This is not happening in
my web application. I am not sure if this is an already identified
issue with SqlCacheDependency, SQL2005 (Standard Edition) or the way I
have used these features in my application.

I have also verified this behavior with a Windows Desktop application
and using SqlDependency object. The SqlDependency.OnChange event
handler gets called for ANY updates performed on the table and NOT just
for updates that modify the result set of my query.

 >> Stay informed about: SqlCacheDependency - Cache Invalidation wihout result set .. 
Back to top
Login to vote
Alvin Bruney [MVP]

External


Since: Jan 08, 2007
Posts: 1



(Msg. 2) Posted: Mon Jan 08, 2007 4:04 pm
Post subject: Re: SqlCacheDependency - Cache Invalidation wihout result set modification [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Why the X-Post?

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc

<mrashidsaleem.DeleteThis@hotmail.com> wrote in message
news:1168257760.604374.244330@11g2000cwr.googlegroups.com...
> Using the SQL 2005 "query notification" caching mechanism, I am caching
> three columns (UserId, UserName, Password) of a table called UserInfo
> in my web application cache. However, the cache gets invalidated (and
> needs to be re-loaded) when another column LastUpdateDateTime of the
> same table gets modified. This is NOT as per my expectation. Following
> is what MSDN says about Query Notifications in SQL2005
> (http://msdn2.microsoft.com/en-us/library/ms178604(VS.80).aspx).
>
> "SQL Server 2005 cache dependency is more flexible in the types of
> changes that receive notification. SQL Server 2005 monitors changes to
> the result set of a particular SQL command. If a change occurs in the
> database that would modify the results set of that command, the
> dependency causes the cached item to be invalidated. This allows SQL
> Server 2005 to provide row-level notification."
>
> This means, regardless of updates done to the table, as long as the
> result set of the query is not modified (that is, produces the same
> result), the cache should not be invalidated. This is not happening in
> my web application. I am not sure if this is an already identified
> issue with SqlCacheDependency, SQL2005 (Standard Edition) or the way I
> have used these features in my application.
>
> I have also verified this behavior with a Windows Desktop application
> and using SqlDependency object. The SqlDependency.OnChange event
> handler gets called for ANY updates performed on the table and NOT just
> for updates that modify the result set of my query.
>

 >> Stay informed about: SqlCacheDependency - Cache Invalidation wihout result set .. 
Back to top
Login to vote
mrashidsaleem

External


Since: Jan 08, 2007
Posts: 2



(Msg. 3) Posted: Tue Jan 09, 2007 11:24 pm
Post subject: Re: SqlCacheDependency - Cache Invalidation wihout result set modification [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I just wanted to get attention of a maximum number of users to quickly
resolve the issue that I am facing; sorry if this is not the proper
way...
Does anybody here have come across the problem and devised a way around
/ found proper solution etc.?
 >> Stay informed about: SqlCacheDependency - Cache Invalidation wihout result set .. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
database 'DBNAME' is not enabled for SQL cache notification - I'm getting this message on SqlCacheDependencyAdmin.EnableTableForNotifications and aspnet_regsql.exe -C connstr -lt Yet, the following execution has finished successfully: ALTER DATABASE dbname SET ENABLE_BROKER

Email query result - Hi, I am new to SQL 2005. I was trying to set up SQL agent to send a query result via email. EXEC msdb.dbo.sp_send_dbmail @recipients = 'user@company.com', @query = 'SELECT * FROM msdb.dbo.DASD, @subject = 'DB Space', ..

Is the trace flag (8720) needed? - I'm converting SQL7 to SQL2K. The database scripts have an statement: DBCC TRACEON (8720) It's from third party vendor for previous database build or update. I'd like to know if the trace flag 8720 still is needed for SQL 2K or not. If not, I'm going to....

High-level requirement for a pub-sub app - Thank you, Shyam, for your answer to my question regarding the distributor and delivery protocol objects. Your explanation was very helpful to me. Now I have another question for you and the group. I've been given a rough sketch of a possible futur...

Mapi error - I am trying set up notfication so it emails when jobs fail etcc. I am using sql server 2000 service pack 3A i have set up a mail profile and when I go into enterprise manger and go to test sql mail it says it opens and closes my mapi connection fine.....
   Database Help (Home) -> Notification Services All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]