473,320 Members | 1,820 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,320 software developers and data experts.

application level variables

RP
Hi all, I wanted to know if there are any limitations to storing some custom
objects I have written at application level to avoid having to
create/destroy with every request. These are not ado objects, just some
custom ones I have written with basically functions and method that do some
basic stuff - file i/o etc. I know there used to be limitations with classic
asp and application objects. Do the same apply to asp.net?

TIA,
RP
Nov 17 '05 #1
5 1881
The limitations have been mostly removed. If you wrap file I/O stuff or
connection objects remember to dispose of them correctly so that you don't
leak memory.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RP" <rp@nospam.com> wrote in message
news:#5**************@TK2MSFTNGP09.phx.gbl...
Hi all, I wanted to know if there are any limitations to storing some custom objects I have written at application level to avoid having to
create/destroy with every request. These are not ado objects, just some
custom ones I have written with basically functions and method that do some basic stuff - file i/o etc. I know there used to be limitations with classic asp and application objects. Do the same apply to asp.net?

TIA,
RP

Nov 17 '05 #2
RP
Thanks for the reply. So when is it recommended and when is it not
recommended to store commonly used objects at application state?

thanks!

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:uH**************@TK2MSFTNGP10.phx.gbl...
The limitations have been mostly removed. If you wrap file I/O stuff or
connection objects remember to dispose of them correctly so that you don't
leak memory.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RP" <rp@nospam.com> wrote in message
news:#5**************@TK2MSFTNGP09.phx.gbl...
Hi all, I wanted to know if there are any limitations to storing some

custom
objects I have written at application level to avoid having to
create/destroy with every request. These are not ado objects, just some
custom ones I have written with basically functions and method that do

some
basic stuff - file i/o etc. I know there used to be limitations with

classic
asp and application objects. Do the same apply to asp.net?

TIA,
RP


Nov 17 '05 #3
Application objects have scope as long as the application is running. When a
first user logs in to the system, the application starts to run. It doesn't
terminate when the user logs off or closes the browser. It may stop for
example when IIS resets or when you explicitly terminate the application so
conceivably the application can be running for days. Do you want your
objects to persist that long? Its up to you. Objects in the application
object can be accessed by all aspx pages. These objects are not thread safe
so you will need to take the appropriate synchronization precautions just
like you do with global objects because that is what they are. There are
quite a number of articles on msdn to guide you thru.

regards.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RP" <rp@nospam.com> wrote in message
news:eS*************@tk2msftngp13.phx.gbl...
Thanks for the reply. So when is it recommended and when is it not
recommended to store commonly used objects at application state?

thanks!

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:uH**************@TK2MSFTNGP10.phx.gbl...
The limitations have been mostly removed. If you wrap file I/O stuff or
connection objects remember to dispose of them correctly so that you don't leak memory.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RP" <rp@nospam.com> wrote in message
news:#5**************@TK2MSFTNGP09.phx.gbl...
Hi all, I wanted to know if there are any limitations to storing some

custom
objects I have written at application level to avoid having to
create/destroy with every request. These are not ado objects, just some custom ones I have written with basically functions and method that do

some
basic stuff - file i/o etc. I know there used to be limitations with

classic
asp and application objects. Do the same apply to asp.net?

TIA,
RP



Nov 17 '05 #4
The most important thing to remember is that, while you can still store
items in the Application Collection, it is not threadsafe, and it is
therefore recommended that you use the Application Cache, which was designed
specifically for ASP.Net instead.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"RP" <rp@nospam.com> wrote in message
news:eS*************@tk2msftngp13.phx.gbl...
Thanks for the reply. So when is it recommended and when is it not
recommended to store commonly used objects at application state?

thanks!

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:uH**************@TK2MSFTNGP10.phx.gbl...
The limitations have been mostly removed. If you wrap file I/O stuff or
connection objects remember to dispose of them correctly so that you don't leak memory.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RP" <rp@nospam.com> wrote in message
news:#5**************@TK2MSFTNGP09.phx.gbl...
Hi all, I wanted to know if there are any limitations to storing some

custom
objects I have written at application level to avoid having to
create/destroy with every request. These are not ado objects, just some custom ones I have written with basically functions and method that do

some
basic stuff - file i/o etc. I know there used to be limitations with

classic
asp and application objects. Do the same apply to asp.net?

TIA,
RP



Nov 17 '05 #5
RP
Good point. Thanks for the info.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Oy**************@TK2MSFTNGP09.phx.gbl...
The most important thing to remember is that, while you can still store
items in the Application Collection, it is not threadsafe, and it is
therefore recommended that you use the Application Cache, which was designed specifically for ASP.Net instead.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"RP" <rp@nospam.com> wrote in message
news:eS*************@tk2msftngp13.phx.gbl...
Thanks for the reply. So when is it recommended and when is it not
recommended to store commonly used objects at application state?

thanks!

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:uH**************@TK2MSFTNGP10.phx.gbl...
The limitations have been mostly removed. If you wrap file I/O stuff or connection objects remember to dispose of them correctly so that you

don't leak memory.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"RP" <rp@nospam.com> wrote in message
news:#5**************@TK2MSFTNGP09.phx.gbl...
> Hi all, I wanted to know if there are any limitations to storing some custom
> objects I have written at application level to avoid having to
> create/destroy with every request. These are not ado objects, just some > custom ones I have written with basically functions and method that do some
> basic stuff - file i/o etc. I know there used to be limitations with
classic
> asp and application objects. Do the same apply to asp.net?
>
> TIA,
> RP
>
>



Nov 17 '05 #6

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

Similar topics

33
by: aa | last post by:
I am migrating to PHP from ASP where there are the Application Scope variables which are accessible from any page on a website and which are used, in particular, for hit counters. Is there a similar...
4
by: BB | last post by:
Hello all, I might be missing something here, but am trying to understand the difference between using application-level variables--i.e. Application("MyVar")--and global variables--i.e. public...
2
by: Don | last post by:
I'm asking this for a friend of mine, so forgive me if I'm getting some of the terminology wrong (I don't have any experience with ASP.NET). I've got an ASP application that has some classes that...
2
by: Mel | last post by:
This may be a stupid question, but here goes... I have created a NameValueCollection in my website's application state. If, during a page request, I add a string key and string value to the...
22
by: Shelby | last post by:
Hi, I used System.Windows.Forms.Application.DoEvents() in a loop to handle user click close button . Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)...
4
by: GS | last post by:
Hi, I'd rather start from a good design and go from there so would be greatfull for any input. I have a simple ASP.NET application and would like to make solution elegant. I store settings in...
1
by: metsys | last post by:
We have an ASP.NET 2.0 (C#) application that is divided into multiple layers. The multiple layers come from having a web project and 2 different class library projects in the same solution. I'm...
4
by: chandu | last post by:
Hello, declaring class level variables is good approach or not in c#. in C++ we used prefer diclaring class level variables more than local variables. i had a discussion with somebody that...
7
by: Michael Bray | last post by:
I have an application that has a webservice, and the web service is utilizing Application variables to store login tokens for clients. However, the application variable seems to be disappearing on...
4
by: Control Freq | last post by:
Hi, Still new to csharp. I am coming from a C++ background. In C++ I would create a few top level variables in the application class. These are effectively global variables which can be accessed...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.