Global ASA Issues

M

MDW

I would like to start using the global.asa file on an ASP app to store
information like connection strings, contact e-mail addresses, etc. However,
the person I report to is nervous about this, mostly because he's never been
exposed to it.

He is of the opinion (because he "thinks he heard somewhere") that
application variables - and the ASA file in general - is bad. He's giving me
a bit of push-back until I can satisfy him that introducing this won't cause
problems for the site.

Anything I could find on the MSDN just says how to use it, how it works,
etc...which is stuff I already know. Has anyone had any problems with the ASA
file? Does it cause any performance lagging? Is there any chance that the
Application_OnStart event won't fire?

Thanks.
 
C

CJM

Storing connection strings and similar things in Application variables is a
very sensible approach - though not the only approach.

As Patrice has indicated, storing objects (particular non-agile objects
AFAIK), however, is a Bad Thing (tm), for the reasons indicated.

I would try and turn the argument around on your boss - what argument has he
got against Application Variables...??
 
M

MDW

I would try and turn the argument around on your boss - what argument has he
got against Application Variables...??

As I said, he "heard they were bad"...and then it falls on me to prove or
disprove the theory.

His biggest concern, I think, is that it would degrade performance. However,
we're talking about a matter of half a dozen string variables. Nothing too
frightening, at least to me. (No need to worry about my trying to store
objects; I graduated from the school of "create - use - destroy" programming.)

Other than with objects, would the use of application variables have a
NOTICABLE effect on performance? I don't think our site has ever had more
than 100 simultaneous users.
 
M

MDW

Thanks Patrice. I printed that article (and another one referenced by that
article). That should help.
 
M

McKirahan

MDW said:
As I said, he "heard they were bad"...and then it falls on me to prove or
disprove the theory.

His biggest concern, I think, is that it would degrade performance. However,
we're talking about a matter of half a dozen string variables. Nothing too
frightening, at least to me. (No need to worry about my trying to store
objects; I graduated from the school of "create - use - destroy" programming.)

Other than with objects, would the use of application variables have a
NOTICABLE effect on performance? I don't think our site has ever had more
than 100 simultaneous users.

"Application variables are good."
http://www.learnasp.com/learn/globalproblems.asp

"What the benefits are of using session and application variables"
http://www.devarticles.com/c/a/ASP/Maintaining-Session-State-With-ASP
 
M

MDW

Very helpful. However, a question. On the first article you referenced, it says

"Of course Application variables have no dependence on cookies. They are not
required at all."

However, according to Microsoft
(http://support.microsoft.com/kb/175167/EN-US/), application variables DO
require cookies.

"The Session and Application variables are stored on the server. A
SessionID, which is generated at the start of an ASP session, is an in-memory
cookie that is stored on the client to identify the Session variables. As a
result, the client must have cookies enabled in the browser for Session and
Application variables to work."

Which is right?
 
C

CJM

MDW said:
As I said, he "heard they were bad"...and then it falls on me to prove or
disprove the theory.

His biggest concern, I think, is that it would degrade performance.
However,
we're talking about a matter of half a dozen string variables. Nothing too
frightening, at least to me. (No need to worry about my trying to store
objects; I graduated from the school of "create - use - destroy"
programming.)

Other than with objects, would the use of application variables have a
NOTICABLE effect on performance? I don't think our site has ever had more
than 100 simultaneous users.

Performance-wise it will be at least as fast as storing them in an ini
file/the registry/a DB.

And broadly speaking, it will also be quicker to develop and easier to
maintain than many alternatives...

There are other more subtle benefits - storing a connection string in the
one place helps ensure that connection pooling is used...

Chris
 
A

Adrienne

Gazing into my crystal ball I observed =?Utf-8?B?TURX?=
Very helpful. However, a question. On the first article you referenced,
it says

"Of course Application variables have no dependence on cookies. They
are not required at all."

However, according to Microsoft
(http://support.microsoft.com/kb/175167/EN-US/), application variables
DO require cookies.

"The Session and Application variables are stored on the server. A
SessionID, which is generated at the start of an ASP session, is an
in-memory cookie that is stored on the client to identify the Session
variables. As a result, the client must have cookies enabled in the
browser for Session and Application variables to work."

Which is right?

Best thing to do is to test it, then you know for sure. One of the
benefits of having more than one browser, maybe IE, Firefox and Opera. Set
one of them to accept NO cookies, one to only accept Session Cookies, and
the last all cookies, then run a test.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top