A class in my ASP.net website requires access to a database table several times for each request. Database table rarely can change, if ever, maybe twice a month.
In the stable manufacturer of the class, the table is obtained from DB and a static is cached in the local variable. Whenever the classroom requires access to the table, then it uses the cached, stable version.
My question relates to the age of this cached, stable version of the table.
I understand that this class has been started for the first time or a stable method is used in class. But how often is it on the web server? If the table changes and we want to reset this stable version of the table, what will happen?
Actually, I am thinking, is this table received once and then only when I restart IIS, in relation to the site and IIS, whether to reset the static class Will be triggered for this, due to which static table can be restarted?
Instead of a fixed variable on a square, why not add it to the 'application' collection? It has got a good understanding of life (website life) and easily web. Connection can be recycled by touching. Populate it into global.asax in your application_Start method.
Comments
Post a Comment