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

What's the current wisdom on storing objects in the Application Variable?

In classic ASP, it was considered a bad idea to store VB6-created
objects in the Application variable for various threading issues.

What's the current wisdom on storing objects in the Application variable
in ASP.NET?

I am thinking of storing several objects there, not too large, so there
won't be any memory issues or anything like that. Is ASP.NET still
subject to threading issues?

Thanks.
Nov 18 '05 #1
4 1983
any shared objects do need to worry bout threading... so make it thread
safe...
use lock / mutexs etc to make it thread safe..

and application isnt the best place to store any data.. instead try using
cache object
cache object is smart... you can set the priority and you can set absolute /
sliding expiry times.. you can set callbacks if the object is unloaded...
and most important... cache removes object if its overloaded... and the way
it removes it is based on priority set by you..

application on the other hand would cause a restart if overloaded with data.

--
Regards,

HD

"Frank Rizzo" <no**@none.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
In classic ASP, it was considered a bad idea to store VB6-created
objects in the Application variable for various threading issues.

What's the current wisdom on storing objects in the Application variable
in ASP.NET?

I am thinking of storing several objects there, not too large, so there
won't be any memory issues or anything like that. Is ASP.NET still
subject to threading issues?

Thanks.

Nov 18 '05 #2
couple of links to help you

creating multi threaded object in c#
http://msdn.microsoft.com/library/de...ithvisualc.asp

cache object
http://msdn.microsoft.com/library/de...classtopic.asp

--
Regards,

HD

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
any shared objects do need to worry bout threading... so make it thread
safe...
use lock / mutexs etc to make it thread safe..

and application isnt the best place to store any data.. instead try using
cache object
cache object is smart... you can set the priority and you can set absolute / sliding expiry times.. you can set callbacks if the object is unloaded...
and most important... cache removes object if its overloaded... and the way it removes it is based on priority set by you..

application on the other hand would cause a restart if overloaded with data.
--
Regards,

HD

"Frank Rizzo" <no**@none.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
In classic ASP, it was considered a bad idea to store VB6-created
objects in the Application variable for various threading issues.

What's the current wisdom on storing objects in the Application variable
in ASP.NET?

I am thinking of storing several objects there, not too large, so there
won't be any memory issues or anything like that. Is ASP.NET still
subject to threading issues?

Thanks.


Nov 18 '05 #3
Hi Frank:

You can keep a .NET object in Application state, but you do need to be
careful to avoid concurrent access and bottlenecks.

If the objects are not frequently used - consider the Cache object
instead. 'Frequently' is a relative term of couse...

It would still be a bad idea to store VB6 objects in Application state
in ASP.NET, as they need to run in a single threaded apartment - but I
don't think that was what you were asking.

--
Scott
http://www.OdeToCode.com

On Tue, 13 Jan 2004 12:15:37 -0800, Frank Rizzo <no**@none.com> wrote:
In classic ASP, it was considered a bad idea to store VB6-created
objects in the Application variable for various threading issues.

What's the current wisdom on storing objects in the Application variable
in ASP.NET?

I am thinking of storing several objects there, not too large, so there
won't be any memory issues or anything like that. Is ASP.NET still
subject to threading issues?

Thanks.


Nov 18 '05 #4
Scott Allen wrote:
Hi Frank:

You can keep a .NET object in Application state, but you do need to be
careful to avoid concurrent access and bottlenecks.
I want to store read-only objects that would be loaded in the beginning
of the app via global.asax. This would have things like lookup lists,
connection string, etc...things that would not change for the duration
of the application. Given that the data is read-only, would I still
have to worry about concurrent access?

Given this information, do I still need to use the Cache object?


If the objects are not frequently used - consider the Cache object
instead. 'Frequently' is a relative term of couse...

It would still be a bad idea to store VB6 objects in Application state
in ASP.NET, as they need to run in a single threaded apartment - but I
don't think that was what you were asking.

--
Scott
http://www.OdeToCode.com

On Tue, 13 Jan 2004 12:15:37 -0800, Frank Rizzo <no**@none.com> wrote:

In classic ASP, it was considered a bad idea to store VB6-created
objects in the Application variable for various threading issues.

What's the current wisdom on storing objects in the Application variable
in ASP.NET?

I am thinking of storing several objects there, not too large, so there
won't be any memory issues or anything like that. Is ASP.NET still
subject to threading issues?

Thanks.


Nov 18 '05 #5

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

Similar topics

1
by: Liza | last post by:
Hi guys, can anyone explain line number 5 to me. i don't quite understand what is going on there and why. 1 <script language="vbscript" runat="server">sub Application_OnStart 2 getcustomers...
6
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
4
by: hufel | last post by:
Hi, I'm doing my first big project in C# and I'm stuck with a problem that I believe has a simple and efficient solution for it (I just haven't bumped into it yet...). The concept is the...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Group, After a long week end I am back again. Its nice and refreshing after a short vacation so lets get started with .NET once again. Today we will discuss about Isolated Storage. This is...
0
by: Sandra | last post by:
I am using a VB6 COM object with an asp.net project. I am storing the COM object in a session variable but am having a problem accessing the COM object from the session variable. I am getting...
14
by: rsine | last post by:
I did a recent post about what the standard was for naming a string builder object. My concern was that I did not what to use "str" prefix since this is used for strings but did not know what to...
2
by: kito | last post by:
Hi, I wanted to get some advices from you guys. I have a little web-shop in ASP.NET for a project. I have several VB classes, where the most important ones are the "DBmanager" and the...
10
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset...
2
by: teo | last post by:
I need to use the 'Session_End' event in the 'Global.asax' file. It only works if in the 'Web.config' file the 'sessionState mode' Tag is present and its value is set to "InProc" 1) I...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.