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

GAC - Context - Cache

Newbie question related to assemblies in GAC

If I have a business component in the GAC, and the component uses some
context (say it is a windows application ... and so i manually set up a

context ) ...to cache some variables. Will this cache be long-lived and

shared across all sharing applications?
Also if I have some static constructors in some of the classes, when
will they be invoked -- do the normal rules apply here too that they
will be invoked only the first time any shared assembly tries to access

them ?

Jan 10 '07 #1
2 1112
>Will this cache be long-lived and
>
shared across all sharing applications?
No, the assembly is loaded once per application, and you'll have one
copy of the data per appdomain.

>Also if I have some static constructors in some of the classes, when
will they be invoked -- do the normal rules apply here too that they
will be invoked only the first time any shared assembly tries to access

them ?
Yes. Again, once per loaded instance of the assembly.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 11 '07 #2
Mattias,
I greatly appreciate your quick help on this!

Just curious - so is there a way at all for a business component to
cache date on the app server, to be visible by multiple app domains
which would later load this component. (I mean a design pattern if any)

Thanks again!
Mattias Sjögren wrote:
Will this cache be long-lived and

shared across all sharing applications?

No, the assembly is loaded once per application, and you'll have one
copy of the data per appdomain.

Also if I have some static constructors in some of the classes, when
will they be invoked -- do the normal rules apply here too that they
will be invoked only the first time any shared assembly tries to access

them ?

Yes. Again, once per loaded instance of the assembly.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 11 '07 #3

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

Similar topics

6
by: Arsen V. | last post by:
Hello, I have a localization class that I want to use from either Web or Windows Forms apps. Currently it stores some information in the HttpRuntime.Cache object. I want to be able to determine...
3
by: Seth | last post by:
I have been trying to create a mock httpcontext for the purpose of unit testing. I have a class, Customer, that uses cookies. I have set it up to be able to take a httpcontext as a parameter in...
7
by: Mike | last post by:
Hi, I have an ASP.NET solution in which I need to store some information, such as DB user and password. So far, I have used the Context object to share information between the various pages, but I...
8
by: Steph | last post by:
Hi, Is it better to use the URL method to send informations to a page, or to use the context method ? Thanks.
1
by: Rich | last post by:
There doesn't seem to be much doc on Items vs Cache in HttpContext. Basically I want to instantiate a class at web application level so that all web pages can have access to it. The object would...
4
by: Harry Haller | last post by:
What's wrong with this: Error 3 'System.Web.Caching.Cache' is a 'type', which is not valid in the given context public List<AssetSummaryGetAssetSummary() { return...
0
by: nitingoyal2006 | last post by:
i hv build a web service in vb.net using inherited by web service class im saving a member info in mybase.context.cache.item using mybase.context.cache.insert in one procedure in next procedure of...
4
by: Andrus | last post by:
For winforms application with multiple related forms it is reasonable to create Linq database context object in start of application. Context object is released only when application exits. So...
4
by: AAaron123 | last post by:
trying to understand the below shown code. After this is run the browser opens a file-save dialog box for saving the file. I wonder how it knows I want the file saved? But more important, the...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.