ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 28th, 2003, 11:59 AM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
Global.asa

I started working with the global.asa file recently And I have som problem.

I was able to set a application variable in the global.asa and also retrive it from an ASP file that is in the root directory.
The problem is that if that ASP file is in a subdirectory then the application variable is empty.

Is application variables are only transfred in one dir?

Reply With Quote
  #2  
Old July 29th, 2003, 07:26 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Assuming you have 5 different web sites *all* under the wwwroot folder. Something like:


wwwroot
--[web site 1]

--[web site 2]

--[web site 3]

--[web site 4]

--[web site 5]


Application variables are used per web sites.
This means you can have an application variable for web site 1 but you wont be able to read its content from within web site 4 for example.

Now I've a lot of people putting the Connection String into the Application variable.
NOTE: I said Connection String NOT the Connection OBJECT.
This way the Connection String is held inside the Application variable for the entire web site!

But why not put it inside the Session variable one might ask ?

Because, assuming you have 100 users connecting to your web site and that, for some odd reason, you decide to put the connection string into the session variable. You'll end up having/holding 100 Session variable holding the SAME connection String. As opposed to having only ONE Connection String inside the Application variable.


Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old July 29th, 2003, 04:44 PM
benseri benseri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Israel
Posts: 102 benseri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to benseri
Thanks, I only wanted to confirm what I thought, but I still have some simple qustions, If you can:


-Is there a way to share application vars in some websites?

-Does a application var has a life limit?

Reply With Quote
  #4  
Old July 30th, 2003, 08:58 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Maybe this would helps clarify things...

Each application can have only one global.asa and the application variable(s) exist per application.


In order words, image a hosting company that host 3 different web sites/applications. These web sites/applications are:

-yahoo.com
-ebay.com
-vlinces-palace.com

Do you think for one second that I could read the value of the application variable that is on the yahoo.com web site? Even if we all share the same hosting company?
(NOTE: Assuming that we are NOT on dedicated servers)
Answer is NO, I can't see the other application variables thus I can't share/obtain the data that's inside.


As for the life limit of the application variable it loses its data each time the server reboots.

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #5  
Old July 31st, 2003, 01:48 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
Quote:
As for the life limit of the application variable it loses its data each time the server reboots.


I just wanted to expand this a little since it sounds like we ae talking to a more junior developer.

But application variables will loose their data when the asp application hits Application_OnEnd(). YOu can hit application end from several ways. One of those is rebooting the server another would be restarting iis or even relaunching the global.asa with changes.

Sorry for being so anal...
__________________
mr...

mike.rusaw@realpage.com
RalPage, Inc.

"I have made this letter longer than usual, only because I have not had the time to make it shorter." - Blaise Paschal

Reply With Quote
  #6  
Old August 30th, 2003, 02:27 PM
jdailey jdailey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 7 jdailey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
To be noted: I have had session variables CONTINUE to live even after stopping and restarting IIS (in W2K) with the Internet Services Manager - the only way to really flush everything out is stop/start the "Service" (World Wide Web Publishing Service) in Services (Computer Management)

Reply With Quote
  #7  
Old August 30th, 2003, 02:42 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,717 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 40 m 34 sec
Reputation Power: 688

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Global.asa


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway