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:
  #1  
Old November 7th, 2003, 07:52 PM
ankush ankush is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 ankush User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to ankush
Global.asa clearing application variables

What is the difference between this function

function Application_OnStart() {
Application.lock();
Application.contents.removeAll();
Application.staticObjects('cache').item('content')= {};
Application.staticObjects('cache').item('component')= {};
Application.staticObjects('users').item('loggedin')= {};
Application.staticObjects('users').item('notloggedin')= {};
Application.unlock();
}

AND THIS FUNCTION :

function Application_OnStart() {
Application.contents.removeAll();
Application.lock();
Application.staticObjects('cache').item('content')= {};
Application.staticObjects('cache').item('component')= {};
Application.staticObjects('users').item('loggedin')= {};
Application.staticObjects('users').item('notloggedin')= {};
Application.unlock();
}


The Removeall functions appears before the lock function. I feel it will clear all the application variables from the memory more effectively in the second case than the first.
All suggestions are welcome....

Thank you

Ankush

Reply With Quote
  #2  
Old November 7th, 2003, 10:36 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,957 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 15 h 35 m 19 sec
Reputation Power: 802
Application.lock gives your code exclusive use of the Application object until you unlock. Locking prior to editing or removing nodes would be my recommendation, this will prevent another user from adding/changing any application variables during your code execution.

Reply With Quote
  #3  
Old November 9th, 2003, 01:48 PM
ankush ankush is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 ankush User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to ankush
Global.asa

I feel using the function application. removeall() can be used prior to the application.lock(), since I want to clear all previous application variables, if there are any left, as soon as the application starts. But the individual variables can be removed after the application.lock(). Am I taking the right approach?
Can you give me a sample global.asa file code and usage of application.removeall() function..


Ankush

Reply With Quote
Reply

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


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 3 hosted by Hostway
Stay green...Green IT