SQL Server :: Server Cache Dependency Enable Tables?
Aug 25, 2010Using the [Code].... for server cache Dependency, to get a list of the tables that are enabled, We use the line below:
[Code]....
Using the [Code].... for server cache Dependency, to get a list of the tables that are enabled, We use the line below:
[Code]....
I have a server control that I developed which generates navigation based on a third party CMS API. Currently I am caching this control using the PartialCaching attribute. The CMS uses cache key dependencies to invalidate the cache when a user makes an edit, however in the case of my server control it does not get invalidated and the updated navigation will not show up until the cache expiration set by the PartialCaching attribute.Here is my two part question:
What is the proper way to programmatically cache a server control, without using the PartialCaching attribute, and adding a cache key dependency?
Is it possible to continue to use the PartialCaching attribute and add a cache key dependency?
I think there are some steps to enable SQL Cache Depdndency :Enabling notifications, changes in web.xml and then using Cache Dependency object.
View 2 Repliesi am trying to setup SqlCacheDependency with MS SQL Server 2008, i am using
aspnet_regsql.exe cmd line tool. I am able to enable it for database but when try to do it for table i get the following error message.Enabling the table for SQL cache dependency.
.An error has happened. Details of the exception: Login failed for user 'myUserName'.
Unable to connect to the SQL database for cache dependency registration.
I want to use SQL Server based Cache dependency without data source control.How can I do it?I am binding data to grid through code.
View 5 RepliesI make use of SMO namaspace to get Table, Function, Procedure names from the DB.
Now I've intended to get the tables [Column] name and the relation (dependency) among the tables. Is this possible?
I configured cache dependency on a file on the server, the cache dependency event stops responding to file changes once in 2 or 3 days. After I perform IISReset on the server, it works fine.
View 1 RepliesI can't get SqlCacheDependency to work with a simple stored proc (SQL Server 2008):
create proc dbo.spGetPeteTest
as
set ANSI_NULLS ON
set ANSI_PADDING ON [code]...
And here's my ASP.NET code (3.5 framework):
-- global.asax
protected void Application_Start(object sender, EventArgs e)
[code]....
I've got a web application that runs of a state server. It looks like soon it may need to distributed and there will be two web servers behind a load balancer.
This works great for session state but my next challenge is Cache
My application leverages heavily of cache. I understand ASP.Net 4.0 will be offering more here but nothing much has been said about the how too.
There are two challenges that I face
1). Each webserver will have its own copy of cache whereas it would be more efficient to put this to a third server the same as session state is put to state server.
2). The real challenge is keeping cache in sync if a simple dataset derived from the database is changed my code dumps that cache item and reloads the cache. That's all well on one webserver but webserver number two wont know to drop that particular cache item and reload it. This could cause some unexpected problems in the application.
For scenario number 2 I could attempt to do some smart coding so server number two knows to dump the cache and reload it.
My guess is someone else has already been here before and there's probably a better implementation approach rather than writing extra code.
Does anyone know how I could achieve the goal of keeping Cache in sync between multiple webservers or even better farm Cache management to another server?
How do I setup caching for a Page in ASP.NET and give it a cache key dependency? I am familiar how to do this with a UserControl, I set a Partial Caching attribute and then set
this.CachePolicy = new CacheDependency(..)
How would I do this for a Page? It does not have a CachePolicy object,
TL;DR: Which is likely faster: accessing static local variable, accessing variable stored in HttpRuntime.Cache, or accessing variable stored in memcached?At work, we get about 200,000 page views/day. On our homepage, we display a promotion. This promotion is different for different users, based on their country of origin and language.
All the different promotions are defined in an XML file on each web server. We have 12 web servers all serving the same site with the same XML file. There are about 50 different promotion combinations based on country/language. We imagine we'll never have more than 200 or so (if ever) promotions (combinations) total.
The XML file may be changed at any time, out of release cycle. When it's changed, the new definitions of promotions should immediately change on the live site. Implementing the functionality for this requirement is the responsibility of another developer and I.
Originally, I wrote the code so that the contents of the XML file were parsed and then stored in a static member of a class. A FileSystemWatcher monitored changes to the file, and whenever the file was changed, the XML would be reloaded/reparsed and the static member would be updated with the new contents. Seemed like a solid, simple solution to keeping the in-memory dictionary of promotions current with the XML file. (Each server doing this indepedently with its local copy of the XML file; all XML files are the same and change at the same time.)
The other developer I was working holds a Sr. position and decided that this was no good. Instead, we should store all the promotions in each server's HttpContext.Current.Cache with a CacheDependency file dependency that automatically monitored file changes, expunging the cached promotions when the file changed. While I liked that we no longer had to use a FileSystemWatcher, I worried a little that grabbing the promotions from the volitile cache instead of a static class member would be less performant.
(Care to comment on this concern? I already gave up trying to advocate not switching to HttpRuntime.Cache.)
Later, after we began using HttpRuntime.Cache, we adopted memcached with Enyim as our .NET interface for other business problems (e.g. search results). When we did that, this Sr. Developer decided we should be using memcached instead of the HttpRuntime (HttpContext) Cache for storing promotions. Higher-ups said "yeah, sounds good", and gave him a dedicated server with memcached just for these promotions. Now he's currently implementing the changes to use memcached instead.
I'm skeptical that this is a good decision. Instead of staying in-process and grabbing this promotion data from the HttpRuntime.Cache, we're now opening a socket to a network memcached server and transmitting its value to our web server.This has to be less performant, right? Even if the cache is memcached. (I haven't had the chance to compile any performance metrics yet.)On top of that, he's going to have to engineer his own file dependency solution over memcached since it doesn't provide such a facility.
Wouldn't my original design be best? Does this strike you as overengineering? Is HttpRuntime.Cache caching or memcached caching even necessary?
asp.net 2.0 MSVS2005 vb.net
I do this..I pull up a SQL multi view SELECT query (thats a stored proc with 3 SELECT statements in it).
[Code]....
I then run thru dr and dr.nextresult and populate controls with it.
The above is fast.
QUESTION : Can I cache at the SQLcommand level in the above code ?
NOTE: I can NOT use SQL dependency as my query doesnt fit the rules
I have a table that contains item data. If the item is a particular type further information exists to describe the item. The additional information isn't that heavy however the number of records in relation to the main file will be quite small (less than
5%).
So I have 2 scenarios:1) Put the additional data in the main table and take tha hit on storage
2) Create an additional table and link the 2 together
If we were talking huge amounts of data I can understand that 2) would be the obvious choice but given the simplicity should 1) be a consideration?
If 2) is the answer - is it possible to create a dependency between the 2 tables when the item is 'that' particular type. In other words wnsure the addition data is populated for the required items and not others.
As I know, we can use INSERT INTO (....) SELECT FROM command to select data from one table and can insert into another table.
Now I need instead of 1 table, I want to select data from one table and Insert into another 2 tables.
Shall I write another INSERT INTO (..) SELECT FROM command or is there any other way?
how to connect the two tables of the sql server 2008 databse in C#.
in this there are two tables
1) Tour header(id, name, city, destination)
2) Tour Detail(id, tour id, day no, title,description,images)in this id of tour header and tour id of tour header will be same.now i want to retrieve the data on the basis of when id==tour id.how can we can run the query of two tables.
I am using bulk insert concept to export the data from dat file to tables(Two tables). I am using the temporary table for to do the calculation and insertion to two tables. My problem is whenever I selecting the temp table data after the execution of bulk insertion , the order is changing .I need to get the order as it is in file order(csv,dat,txt).
View 5 RepliesThere are more than 30 tables in my database.
I need to have a server log that will help to determine the number of items entered into the db and where those items are entered, without having query each table. It should be able to give me the average monthly volume of items input in SQL.
Can this be done using Sql Triggers or any other alternative?
I have to make sure that if I use trigger as the alternative I should have only one table to be updated with all the details of the Updates/Inserts being inserted into the Trigger table after the insertion into the original table.
Below given are some of the create table statements that I have for which I need to have a server log of the updates & inserts.
[Code]....
What is the best way to clean a database tables of data, and have the unique ids fields start at 1 again?
View 4 RepliesI have different urls that points to the same code
www.url1.com
www.url2.com
I need to use the cache, but if the asp net cache is enabled when someone access to www.url1.com next person accessing www.url2.com could get the previously cached data (www.url1.com)
I need to have ALL caches activated except this one.
We have installed the .net 4.0 framework and registered asp.net 4.0 to IIS using aspnet_regiis, but we keep getting this error when we try to create a new (or upgrade an existing) project on our development box.
"The ASP.NET 4.0 Web extension is not enabled on the Web server. <our site address> is targeting ASP.NET 4.0.
Do you want to enable ASP.NET on the Web Server?"
When we hit "Yes", it pulls up another message of:
"ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly, Press F1 for more details."
I'm working with Oracle database and I want to improve performance of my website.I read about caching. So is it possible to implement caching (SQL Server Database Dependency) with oracle?
View 2 RepliesThere is a certain query that is being called from an ASP .NET page. I studied the execution plan of that query in Management Studio and 87% is for a sort. I badly need the sorting or else the data displayed would be meaningless.
Is there anyway that I can request SQL Server to cache a sorted results set so it will return the data faster in consequent runs?
Or is SQL Server smart enough to do the cache handling and am I doing mistake by trying to force it to cache results, if that is possible?
UPDATE:
I just read in an article that creating a View with a clustered index will increase performance because the index will persist the data in a view to disk. Is this true? How do i get about doing this?
We have 64-bit Windows server and we need to explicitly enable the 32-bit mode in the Application Pool used by our web site, because the MS Jet Engine Data Provider used to import data from Excel does not run.
I am not sure, if we enable the 32-bit mode will we still get the advantage of 64-bit Server?
getting below error when trying to display list of providers, i really appreciate feedback on troubleshooting and fixing it.Server Error in '/testload' Application.Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details:ystem.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.Source Error:
[Code]....
Let's assume you have a big complex index page, that shows news articles and stuff. It's not going to change very often. Can you cache it somehow on the serverside, so requests don't force to server to dynamically generate the entire page every time someone visits it? Or does ASP.NET do this automatically? If so, how does it know if something has changed?
View 2 Replies