Wednesday, March 28, 2012

Help with Sql Cache Dependency

Hello all.. i'm having a major issue with my Sql Express 2005 database :(

I'm using wicked code sitemap to allows for a sitemap to be stored in a database.. it uses sql cache dependency to invalidated the cache bla bla

Problem:

After i update a record / add new record the database generates a SqlQueryNotificationStoredProcedure

But it never gets executed. I've done tests on the code it's calling everything accordingly so i'm assuming the problem lies in a configuration setting of the database

done alot of searching around the net and i've found this

GRANT SUBSCRIBE QUERY NOTIFICATIONS TO username

i'm using Windows Authentication how do i run this and will this solve the problem

Thank you in advance

Chris

Any ideas anyone?|||

Well I've found something out..

The sitemap provided from wicked code only invalidates the cache when a new item has been inserted.. from what i can tell anyway

So updates are not displayed.. to get around this problem i've disallowed updates to the sitemap.. i could of writen a stored procedure to delete and recreate the entry however.

If you try deleting and recreating be careful of the ordering if you have set the ID to auto increment.

Happy Coding :D

All the above isWRONG.. i thought it was updating because of visual studios virutal webserver type of thing.. read below post for the correct answer..

Chris

|||

For all those ppl out there strugling with the Wicked Code Sitemap I have some new findings....

Please post thanks if i've helped anyone so i know weather it's worth updating these answers lol..

first of all

1. SQL EXPRESS 2005 DOES NOT SUPPORT QUERY NOTIFICATIONS, so site map will not update on database changes!!!

2. took me hours to find that out stupid me should read up on sql express before introducing it.. :(

3. to fix the updating problem add the following procedure to the SqlSiteMapProvider

publicvoid Refresh()

{

Clear();

_nodes.Clear();

_root =null;

}

personally i just refresh the sitemap on every page request in my master page... this isn't the best way.. only did it because the site doesn't get much traffic and it was easy bad bad bad programmer chris.. lol.. you should only refresh the sitemap on database changes..

please help my mate get more hitswww.drakesterling.com that will display the sitemap too.. i had to do alot of modifications to the CSS adapters to get it working properly any questions on what's shown here i'm happy to answer..

Happy programming all

From Chris

sql

No comments:

Post a Comment