Re: Web.Config AppSettings & Caching

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I fail to see a cogent argument Kevin, where is it ?

--
Terry Burns
http://TrainingOn.net



"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uApGETKQGHA.224@xxxxxxxxxxxxxxxxxxxxxxx
Now lets see
your argument aginst this ?

I give up, Terry. You're right, and all of the architects at Microsoft are
wrong.

--
;-),

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.


"Terry Burns" <me@xxxxxxxx> wrote in message
news:uxuwieHQGHA.2124@xxxxxxxxxxxxxxxxxxxxxxx
I think you have the wrong end of the Stick Kevin.!

It can be deserialized and cached in memory when the application
starts (just like the web.config file). So far, we've done nothing
different from using a web.config file.
Yes we have, we can alter the XML file without restarting the Application


If you are in a situation where you want to know if the Application
values have changed you can keep two sets of values and have your code
check for those changes and act appopriately.

So, what is this "situation where you want to know if the Application
values have changed?" That would be any time they are accessed. So, how
often does the application have to check the "DataSet configuration
file?" Every time one of those values is needed. So, how often does file
IO have to be employed to read and deserialize the "DataSet
configuration file?" Every time one of those values is needed.

Hypothetically, there could be situatuion where the application needs to
know
a value has changed rather than simply using the value. As I state later
on in my
reply, the application only needs to read the XML file once at startup
unless
the value changes, wherein the form used to make the changes updates
the Application("myVariableName(s)").



The only difference here between your database solution and your
"DataSet configuration file" solution is that you've gone from a
full-blown relation database server to a file-based database. The
database (file) still needs to be opened with every read of a
configuration value. And, as I mentioned in my most recent reply, this
is simply not scalable.

No, you have misread me. The Application Start reads the XML file and
stores them in Application("myVariablesName(s)"). These can then be read
by the application as it runs.


I have been known to be wrong from time to time. And I freely admit when
I am. That is how I keep my reputation for being a reliable source of
information. This issue is a tar baby, Terry. The more you whack at it,
the stucker you will get. Might be a good time to back away from it.

I dont need to back away from something I see very clearly as being
valid. My solution
allows the same functionality as the web.config with one simple
difference, and that
is the user base need not be interupted when a value needs to changed.
Now lets see
your argument aginst this ?




--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Terry Burns" <me@xxxxxxxx> wrote in message
news:%23kb7b5CQGHA.516@xxxxxxxxxxxxxxxxxxxxxxx
Actually it was Kevin, not Karl who said this.

Aside from who actually said it, using caching is not neccesary. On
application start the values can be read into Application keys and read
from there throughout the program. If you want to change this, you can
write an admin utility which changes the Application version of the
values when the SQL data changes. Actually, you dont even need an SQL
server, you can use a DataSet and write/read the values from there, but
do it through a maintenance form which updates the application values.
If you are in a situation where you want to know if the Application
values have changed you can keep two sets of values and have your code
check for those changes and act appopriately.


This way you get the best of both worlds.

--
Terry Burns
http://TrainingOn.net


"Peter Bromberg [C# MVP]" <pbromberg@xxxxxxxxxxxxxxxxxxx> wrote in
message news:3AF94235-43AE-49D3-BE55-E61DABF9CDD9@xxxxxxxxxxxxxxxx
Fred,
As Karl indicated, the config file is processed once when the
application
starts, and even that is lightning fast. Further references to config
data
come from memory. And I agree that using a database to store
configuration
data that doesn't change often is an unneccessary overhead and adds
complexity, unless its an app that already uses a database. In
addition, if
the database is where the change of any config data occurs, one would
additionally have to implement SqlCache callbacks so that the app can
get the
changed data in a timely manner.

Your focus on a high volume app needs to be more in the area of page
rendering, using caching intelligently and things like excessive use
of
Session and ViewState.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"Fred Nelson" wrote:

Hi:

I have written several web applications that obtain their connection
strings from the web.config file. This is very easy to use and it
makes
it easy to move an app from development into production.

I'm in the process of writing a site that will have lots of traffic
so
I'm trying to save resources everyplace that I can.

My question is - do the web.config app settings get loaded once when
the
application starts - or does the application read the entire XML
web.config file everytime that I request the connection string.

If the web.config is read each time then I will create a simple class
library to return the string.

Thanks for your help!

Fred











.



Relevant Pages

  • Re: Web.Config AppSettings & Caching
    ... Can all users settings be changed without the app restarting? ... Microsoft *has* modified the configuration model between versions ... The only difference here between your database solution and your ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web.Config AppSettings & Caching
    ... IO have to be employed to read and deserialize the "DataSet configuration ... The only difference here between your database solution and your "DataSet ... .Net Developer ... unless its an app that already uses a database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web.Config AppSettings & Caching
    ... Terry Burns ... Configuration Sections which have the attribute "restartOnExternalChanges" ... Therefore, God exists. ... The only difference here between your database solution and your ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Using VB6 dll in Delphi app.
    ... of the app is reading a database for customer equipment configuration ... storing data in a 3rd party database ... while the Delphi app is the back-end processing piece. ...
    (microsoft.public.vb.general.discussion)
  • Re: Web.Config AppSettings & Caching
    ... let's drop the requirement for a database and go to DataSet. ... employed to read and deserialize the "DataSet configuration file?" ... Actually, you dont even need an SQL server, you ... unless its an app that already uses a database. ...
    (microsoft.public.dotnet.framework.aspnet)