473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Web.Config AppSettings & Caching

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
Mar 4 '06 #1
17 3213
If you overwrite the web.config, the application restarts. This is an
indicator that the entire file is read when the application starts or it
would not need to restart it.

The better approach is to store configuration settings for the application
in an SQL sever, this way if your application dynamics change you dont need
to interupt service to its users.

--
Terry Burns
http://TrainingOn.net
"Fred Nelson" <fr**@smartybird.com> wrote in message
news:Oy**************@TK2MSFTNGP14.phx.gbl...
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

Mar 4 '06 #2
It's cached after the first request to it.

Karl

--
http://www.openmymind.net/

"Fred Nelson" <fr**@smartybird.com> wrote in message
news:Oy**************@TK2MSFTNGP14.phx.gbl...
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

Mar 4 '06 #3
> The better approach is to store configuration settings for the application
in an SQL sever, this way if your application dynamics change you dont
need to interupt service to its users.
Unless one is developing a database application, this isn't a good idea.
Licensing for SQL Server is quite expensive.

Some other considerations: Having to fetch frequently-used data that doesn't
change very often from a database repeatedly is a performance issue. You
could cache the data, but again you run into the problem of changing the
configuration data on the fly and the app not being aware of it. I believe
this is why the web.config file is read once and then cached.

Restarting the app should not be a problem necessarily. First if you are
running IIS 6, this can be done gracefully, with no interruption of service.
If you are using IIS 5, it could cause an interruption in service, but doing
so infrequently and at the right time should minimize the issues involved.
In either case, the application should always be designed to handle a
restart as gracefully as possible, as this is a certain eventuality.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:O7*************@TK2MSFTNGP15.phx.gbl... If you overwrite the web.config, the application restarts. This is an
indicator that the entire file is read when the application starts or it
would not need to restart it.

The better approach is to store configuration settings for the application
in an SQL sever, this way if your application dynamics change you dont
need to interupt service to its users.

--
Terry Burns
http://TrainingOn.net
"Fred Nelson" <fr**@smartybird.com> wrote in message
news:Oy**************@TK2MSFTNGP14.phx.gbl...
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


Mar 4 '06 #4
I disagree. MSDE is an alternaive which is free

Restarting the application with 100+ users is a big issue.

Having a change of system constants using an SQL database is far better than
interupting
all your users.

Regards

--
Terry Burns
http://TrainingOn.net

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:em**************@TK2MSFTNGP15.phx.gbl...
The better approach is to store configuration settings for the
application in an SQL sever, this way if your application dynamics change
you dont need to interupt service to its users.


Unless one is developing a database application, this isn't a good idea.
Licensing for SQL Server is quite expensive.

Some other considerations: Having to fetch frequently-used data that
doesn't change very often from a database repeatedly is a performance
issue. You could cache the data, but again you run into the problem of
changing the configuration data on the fly and the app not being aware of
it. I believe this is why the web.config file is read once and then
cached.

Restarting the app should not be a problem necessarily. First if you are
running IIS 6, this can be done gracefully, with no interruption of
service. If you are using IIS 5, it could cause an interruption in
service, but doing so infrequently and at the right time should minimize
the issues involved. In either case, the application should always be
designed to handle a restart as gracefully as possible, as this is a
certain eventuality.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:O7*************@TK2MSFTNGP15.phx.gbl...
If you overwrite the web.config, the application restarts. This is an
indicator that the entire file is read when the application starts or it
would not need to restart it.

The better approach is to store configuration settings for the
application in an SQL sever, this way if your application dynamics change
you dont need to interupt service to its users.

--
Terry Burns
http://TrainingOn.net
"Fred Nelson" <fr**@smartybird.com> wrote in message
news:Oy**************@TK2MSFTNGP14.phx.gbl...
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



Mar 4 '06 #5
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

Mar 5 '06 #6
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]" <pb*******@yahoo.nospammin.com> wrote in message
news:3A**********************************@microsof t.com...
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

Mar 5 '06 #7
>I disagree. MSDE is an alternaive which is free

There are plenty of free databases. This, however, doesn't address any of
the other issues I brought up.
Restarting the application with 100+ users is a big issue.
This is an assertion, not an argument. An argument contains logic that
justifies the assertion. It is stated as if it were always true. It is
certainly *not* always true, and I would argue that if the application is
designed correctly, so as to handle application restarts (which, as I
pointed out in my earlier message, is an inevitable certainty at some
point), and Best Practices are followed, it does *not* have to be a "big
issue."

To further elaborate, Best Practices include (but are not limited to) the
following:

1. Only data which very infrequently changes should be stored in the
web.config file. Data which changes frequently can (and should) be stored in
other ways (such as a database or some other disk-based storage device). The
web.config file is an application configuration file, not a caching
mechanism.
2. The application should be designed so that it recovers its configuration
state smoothly. This is of course mostly dependent upon number 1, but there
are other considerations involving the application startup and shutdown
logic.
3. Changes in the web.config file should be made very infrequently, and when
done so, should be done at a date and time during which the traffic to the
site is lowest, to minimize service interruptions.
Having a change of system constants using an SQL database is far better
than interupting
all your users.
ASP.Net has been around for over 4 years now, and is in its second version.
A large group of the world's best software architects have worked on this
technology, and they seem to disagree with this assertion. Perhaps they have
thought of a few things you have not. I brought up a few of them in my
earlier message, but you didn't address them.

The most salient of these points is that any such settings must be fetched
repeatedly from the database (each time they are used by *any* instance of a
client object), in order for the application to be synchronized with any
changes to the data in the database. Since these settings are stored at
application scope, they are likely to be accessed often. This entails a
performance issue, as well as the danger of any single database request not
succeeding for any reason. This sort of thing *does* happen, especially with
network database servers, which are at the mercy of the vagaries of the
network they reside on. Both the performance hit and the danger of a failed
database call are increased as the size of the application and the number of
concurrent clients increases, which makes this solution unscalable.

The web.config file, on the other hand, is read only *once* at the start of
the app. It's data is cached in memory, and if any changes occur, it is
refreshed from a file, which is not dependent upon the vagaries of a
network.

No solution is perfect. However, based on the facts which I have enumerated,
I would have to agree with Microsoft that their solution is the most perfect
currently available.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:el**************@TK2MSFTNGP10.phx.gbl...I disagree. MSDE is an alternaive which is free

Restarting the application with 100+ users is a big issue.

Having a change of system constants using an SQL database is far better
than interupting
all your users.

Regards

--
Terry Burns
http://TrainingOn.net

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:em**************@TK2MSFTNGP15.phx.gbl...
The better approach is to store configuration settings for the
application in an SQL sever, this way if your application dynamics
change you dont need to interupt service to its users.


Unless one is developing a database application, this isn't a good idea.
Licensing for SQL Server is quite expensive.

Some other considerations: Having to fetch frequently-used data that
doesn't change very often from a database repeatedly is a performance
issue. You could cache the data, but again you run into the problem of
changing the configuration data on the fly and the app not being aware of
it. I believe this is why the web.config file is read once and then
cached.

Restarting the app should not be a problem necessarily. First if you are
running IIS 6, this can be done gracefully, with no interruption of
service. If you are using IIS 5, it could cause an interruption in
service, but doing so infrequently and at the right time should minimize
the issues involved. In either case, the application should always be
designed to handle a restart as gracefully as possible, as this is a
certain eventuality.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:O7*************@TK2MSFTNGP15.phx.gbl...
If you overwrite the web.config, the application restarts. This is an
indicator that the entire file is read when the application starts or it
would not need to restart it.

The better approach is to store configuration settings for the
application in an SQL sever, this way if your application dynamics
change you dont need to interupt service to its users.

--
Terry Burns
http://TrainingOn.net
"Fred Nelson" <fr**@smartybird.com> wrote in message
news:Oy**************@TK2MSFTNGP14.phx.gbl...
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



Mar 5 '06 #8
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.
Okay, let's drop the requirement for a database and go to DataSet. The
DataSet is stored as an XML file on the server (just like the web.config
file). 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.
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.

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.

The only difference between your "DataSet confiiguration file" and a
web.config is that the web.config file is read once, when the application
starts, and if changed, restarts the application. As I mentioned in my most
recent reply, there are reasons why Microsoft decided against this model.

But to elaborate even further, these are *application-wide configuration
settings*. They are accessed very frequently, and should be changed very
*infrequently*. Even ASPX pages are not opened with each request for a page.
They are cached. And ASPX pages are not used by almost every object instance
in the application.

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.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl... 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]" <pb*******@yahoo.nospammin.com> wrote in message
news:3A**********************************@microsof t.com...
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


Mar 5 '06 #9
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@mine.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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]" <pb*******@yahoo.nospammin.com> wrote in
message news:3A**********************************@microsof t.com...
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



Mar 5 '06 #10
> 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@mine.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl...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@mine.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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]" <pb*******@yahoo.nospammin.com> wrote in
message news:3A**********************************@microsof t.com...
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
>



Mar 5 '06 #11
I fail to see a cogent argument Kevin, where is it ?

--
Terry Burns
http://TrainingOn.net

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA*************@TK2MSFTNGP10.phx.gbl...
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@mine.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl...
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@mine.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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]" <pb*******@yahoo.nospammin.com> wrote in
message news:3A**********************************@microsof t.com...
> 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
>>



Mar 5 '06 #12
I>I fail to see a cogent argument Kevin, where is it ?

It isn't Terry.

In fact, Microsoft *has* modified the configuration model between versions
1.1 and 2.0 of the Framework. Some settings can be saved to a configuration
file without restarting the application, including some custom configuration
settings.

--

Kevin Spencer
Microsoft MVP
..Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
I fail to see a cogent argument Kevin, where is it ?

--
Terry Burns
http://TrainingOn.net

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA*************@TK2MSFTNGP10.phx.gbl...
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@mine.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl...
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@mine.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
> 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]" <pb*******@yahoo.nospammin.com> wrote in
> message news:3A**********************************@microsof t.com...
>> 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
>>>
>
>



Mar 6 '06 #13
OK version 2.0 was not specified. So my questions are for 2.0

1.) Can all users settings be changed without the app restarting ?
2.) If 1) is yes, does this update the cached information when the changes
are made to the web.config ?

For version 1.x, my argument stands.

--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
I>I fail to see a cogent argument Kevin, where is it ?

It isn't Terry.

In fact, Microsoft *has* modified the configuration model between versions
1.1 and 2.0 of the Framework. Some settings can be saved to a
configuration file without restarting the application, including some
custom configuration settings.

--

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
I fail to see a cogent argument Kevin, where is it ?

--
Terry Burns
http://TrainingOn.net

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA*************@TK2MSFTNGP10.phx.gbl...
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@mine.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl...
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@mine.com> wrote in message
> news:%2***************@TK2MSFTNGP15.phx.gbl...
>> 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]" <pb*******@yahoo.nospammin.com> wrote in
>> message news:3A**********************************@microsof t.com...
>>> 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
>>>>
>>
>>
>
>



Mar 6 '06 #14
Hi Teery,

Not interested in arguing, but in answer to your questions:
1.) Can all users settings be changed without the app restarting ?
Configuration Sections which have the attribute "restartOnExternalChanges"
set to "false" will not require an application restart. However, there are
no ASP.Net Sections that can use this.
2.) If 1) is yes, does this update the cached information when the changes
are made to the web.config ?
Again, this doesn't apply to ASP.Net.

Now, if you want to continue arguing, you'll be arguing with yourself. I've
tired of this. It is not profitable to anyone.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl... OK version 2.0 was not specified. So my questions are for 2.0

1.) Can all users settings be changed without the app restarting ?
2.) If 1) is yes, does this update the cached information when the changes
are made to the web.config ?

For version 1.x, my argument stands.

--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
I>I fail to see a cogent argument Kevin, where is it ?

It isn't Terry.

In fact, Microsoft *has* modified the configuration model between
versions 1.1 and 2.0 of the Framework. Some settings can be saved to a
configuration file without restarting the application, including some
custom configuration settings.

--

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
I fail to see a cogent argument Kevin, where is it ?

--
Terry Burns
http://TrainingOn.net

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA*************@TK2MSFTNGP10.phx.gbl...
> 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@mine.com> wrote in message
news:ux**************@TK2MSFTNGP14.phx.gbl...
>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@mine.com> wrote in message
>> news:%2***************@TK2MSFTNGP15.phx.gbl...
>>> 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]" <pb*******@yahoo.nospammin.com> wrote in
>>> message news:3A**********************************@microsof t.com...
>>>> 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
>>>>>
>>>
>>>
>>
>>
>
>



Mar 6 '06 #15
You know, I really dont understand you. You seem to think anyone who does
not
have the same view is smply trying to argue for arguments sake.

What happened to 'Debate' ?, A free exchange of views reagrding a given
subject
where two people can discuss something untill a resolution is spit out. ?

It sounds like you are simply tired of things to the point that you just
cant be bothered !

--
Terry Burns
http://TrainingOn.net


"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...
Hi Teery,

Not interested in arguing, but in answer to your questions:
1.) Can all users settings be changed without the app restarting ?


Configuration Sections which have the attribute "restartOnExternalChanges"
set to "false" will not require an application restart. However, there are
no ASP.Net Sections that can use this.
2.) If 1) is yes, does this update the cached information when the
changes are made to the web.config ?


Again, this doesn't apply to ASP.Net.

Now, if you want to continue arguing, you'll be arguing with yourself.
I've tired of this. It is not profitable to anyone.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
OK version 2.0 was not specified. So my questions are for 2.0

1.) Can all users settings be changed without the app restarting ?
2.) If 1) is yes, does this update the cached information when the
changes are made to the web.config ?

For version 1.x, my argument stands.

--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
I>I fail to see a cogent argument Kevin, where is it ?

It isn't Terry.

In fact, Microsoft *has* modified the configuration model between
versions 1.1 and 2.0 of the Framework. Some settings can be saved to a
configuration file without restarting the application, including some
custom configuration settings.

--

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
I fail to see a cogent argument Kevin, where is it ?

--
Terry Burns
http://TrainingOn.net

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA*************@TK2MSFTNGP10.phx.gbl...
>> 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@mine.com> wrote in message
> news:ux**************@TK2MSFTNGP14.phx.gbl...
>>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@mine.com> wrote in message
>>> news:%2***************@TK2MSFTNGP15.phx.gbl...
>>>> 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]" <pb*******@yahoo.nospammin.com> wrote in
>>>> message news:3A**********************************@microsof t.com...
>>>>> 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
>>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Mar 6 '06 #16
> It sounds like you are simply tired of things to the point that you just
cant be bothered !
Nope, just working about 60 - 70 hours a week, Terry. I have to be very
discriminating with my time.

--

Kevin Spencer
Microsoft MVP
..Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:eb*************@TK2MSFTNGP10.phx.gbl... You know, I really dont understand you. You seem to think anyone who does
not
have the same view is smply trying to argue for arguments sake.

What happened to 'Debate' ?, A free exchange of views reagrding a given
subject
where two people can discuss something untill a resolution is spit out. ?

It sounds like you are simply tired of things to the point that you just
cant be bothered !

--
Terry Burns
http://TrainingOn.net


"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...
Hi Teery,

Not interested in arguing, but in answer to your questions:
1.) Can all users settings be changed without the app restarting ?


Configuration Sections which have the attribute
"restartOnExternalChanges" set to "false" will not require an application
restart. However, there are no ASP.Net Sections that can use this.
2.) If 1) is yes, does this update the cached information when the
changes are made to the web.config ?


Again, this doesn't apply to ASP.Net.

Now, if you want to continue arguing, you'll be arguing with yourself.
I've tired of this. It is not profitable to anyone.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
OK version 2.0 was not specified. So my questions are for 2.0

1.) Can all users settings be changed without the app restarting ?
2.) If 1) is yes, does this update the cached information when the
changes are made to the web.config ?

For version 1.x, my argument stands.

--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
I>I fail to see a cogent argument Kevin, where is it ?

It isn't Terry.

In fact, Microsoft *has* modified the configuration model between
versions 1.1 and 2.0 of the Framework. Some settings can be saved to a
configuration file without restarting the application, including some
custom configuration settings.

--

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
>I fail to see a cogent argument Kevin, where is it ?
>
> --
> Terry Burns
> http://TrainingOn.net
>
>
>
> "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
> news:uA*************@TK2MSFTNGP10.phx.gbl...
>>> 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@mine.com> wrote in message
>> news:ux**************@TK2MSFTNGP14.phx.gbl...
>>>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@mine.com> wrote in message
>>>> news:%2***************@TK2MSFTNGP15.phx.gbl...
>>>>> 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]" <pb*******@yahoo.nospammin.com> wrote in
>>>>> message news:3A**********************************@microsof t.com...
>>>>>> 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
>>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Mar 7 '06 #17
> 1.) Can all users settings be changed without the app restarting ?

Configuration Sections which have the attribute "restartOnExternalChanges"
set to "false" will not require an application restart. However, there are
no ASP.Net Sections that can use this.
OK, then what use it this ?

2.) If 1) is yes, does this update the cached information when the changes
are made to the web.config ?


Again, this doesn't apply to ASP.Net.
I must be missing something, you referenced this, but go on to tell me it
has
no use, where am I going wrong ?

--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
It sounds like you are simply tired of things to the point that you just
cant be bothered !


Nope, just working about 60 - 70 hours a week, Terry. I have to be very
discriminating with my time.

--

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:eb*************@TK2MSFTNGP10.phx.gbl...
You know, I really dont understand you. You seem to think anyone who does
not
have the same view is smply trying to argue for arguments sake.

What happened to 'Debate' ?, A free exchange of views reagrding a given
subject
where two people can discuss something untill a resolution is spit out. ?

It sounds like you are simply tired of things to the point that you just
cant be bothered !

--
Terry Burns
http://TrainingOn.net


"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl...
Hi Teery,

Not interested in arguing, but in answer to your questions:

1.) Can all users settings be changed without the app restarting ?

Configuration Sections which have the attribute
"restartOnExternalChanges" set to "false" will not require an
application restart. However, there are no ASP.Net Sections that can use
this.

2.) If 1) is yes, does this update the cached information when the
changes are made to the web.config ?

Again, this doesn't apply to ASP.Net.

Now, if you want to continue arguing, you'll be arguing with yourself.
I've tired of this. It is not profitable to anyone.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

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

"Terry Burns" <me@mine.com> wrote in message
news:eP**************@tk2msftngp13.phx.gbl...
OK version 2.0 was not specified. So my questions are for 2.0

1.) Can all users settings be changed without the app restarting ?
2.) If 1) is yes, does this update the cached information when the
changes are made to the web.config ?

For version 1.x, my argument stands.

--
Terry Burns
http://TrainingOn.net
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
>I>I fail to see a cogent argument Kevin, where is it ?
>
> It isn't Terry.
>
> In fact, Microsoft *has* modified the configuration model between
> versions 1.1 and 2.0 of the Framework. Some settings can be saved to a
> configuration file without restarting the application, including some
> custom configuration settings.
>
> --
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
>
> Presuming that God is "only an idea" -
> Ideas exist.
> Therefore, God exists.
>
> "Terry Burns" <me@mine.com> wrote in message
> news:OG**************@TK2MSFTNGP09.phx.gbl...
>>I fail to see a cogent argument Kevin, where is it ?
>>
>> --
>> Terry Burns
>> http://TrainingOn.net
>>
>>
>>
>> "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
>> news:uA*************@TK2MSFTNGP10.phx.gbl...
>>>> 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@mine.com> wrote in message
>>> news:ux**************@TK2MSFTNGP14.phx.gbl...
>>>>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@mine.com> wrote in message
>>>>> news:%2***************@TK2MSFTNGP15.phx.gbl...
>>>>>> 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]" <pb*******@yahoo.nospammin.com> wrote
>>>>>> in message
>>>>>> news:3A**********************************@microsof t.com...
>>>>>>> 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
>>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Mar 7 '06 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dan Olson | last post by:
My question is not about how to update an application's config file during run-time, but how to invalidate the cached copy so that if a change to the config file is made, the application can use the...
16
by: DraguVaso | last post by:
Hi, I have a Windows Service running (made in VB.NET), and wanted to be able to change from time to time some parameters by changing them in the App.config. But it seems that the application...
1
by: vkrasner | last post by:
It works with VS2003 and does not in VS2005: in VS2003 : string sMyvalue = ConfigurationSettings.AppSettings; in VS2005 (does not work!!) string sMyvalue = ConfigurationManager.AppSettings; ...
5
by: Jason Shohet | last post by:
in web.config, I want to have a key in appSettings: <add key="Url" value="http://gisbox/mypage.htm?action=state&city="/> But that value doesn't take... I get an error saying it expects a...
1
by: Max | last post by:
hi i have stored my connction string in web.config as we do usually. code of web.confing is given below. check the password field contain "&" character. now when i run my application it gives...
6
by: G | last post by:
Hello, Is it possible (and / or wise) to add custom pieces of code inside your Web.Config file? For example I store the connection string in Web.Config and access it via...
3
by: Blasting Cap | last post by:
I am working on a web app that I want to be able to use a separate config file on, in addition to the web.config file that's already working in the application. If I put the following in the...
2
by: =?Utf-8?B?YW5vbg==?= | last post by:
I am not sure if this is the right forum. Environment : Windows server 2008, IIS 7.0 I get the 'Could not load the file or assembly 'blowery.web.httpCompress' or one of its dependencies. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.