Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Application Domains and Shared Variables

0 views
Skip to first unread message

Jens Samson

unread,
Nov 6, 2001, 8:10:46 AM11/6/01
to
I have been having problems with how shared variables are visible in a WebApplication.

I have posted about this before but I think I have not stated the real question that I have clearly yet.

I have learned that the value of a shared variable is visible through the complete Application Domain. This would mean that if a WebForm gives a value to such a value that another WebForm in the same Application Domain can read that value.

This is a straightforward behaviour that I tried to exploit, but it got me in trouble.

As we are an ASP we have different customers (and one customer can actually be a hundred individuals, so I should actually speak of a CustomerGroup) using the same WebApp simultaneously.

Some of the readonly data will be loaded in Shared Variables so that it does not have to be loaded all the time (I guess I could use ApplicationState too, but that would have the same affect AFAICT). However, this data is not the same for all CustomerGroups, and there is the problem.

As far as I see now, there are three options.

The first is not to use ApplicationState or shared variables at all, but this has the effect that all this information that never changes has to be loaded at every page request, that seems quite some overhead to me.

The second is to build some kind of object that returns the correct data based on which CustomerGroup is requesting it. This would mean that I would have to load all this information of all the customers into the WebApp at the start. If we had a lot of CustomerGroups, this would mean that a lot of information would be loaded into the same ApplicationDomain and it would just sit there and use resources.

And anyway I would try to avoid this, I means that there's just more room for hard to find bugs.

The third option I see is that we would configure things so that every customer has his/her own Application Domain. The problem is that a) I do not know if this is possible without actually installing several copies of the same WebApp concurrently on our server, and b) If it is possible I have not found out how to do this.

Additionally, we would want anyone to be able to log in on a central URL. At that location we find out to which CustomerGoup the login belongs and act accordingly.

So again, any info on Application Domains and how to configure or use them would be appreciated.

Jens


Apokalips XIII

unread,
Nov 6, 2001, 12:35:50 PM11/6/01
to
Keep using your application state or shared variables but put your cached
data into a hash table using for the key, a value which lets you discern
different customer groups. Use that key as an index into your hashtable to
get your cached data.

XIII

"Jens Samson" <je...@esalar.be> wrote in message
news:ueTB7RsZBHA.1716@tkmsftngp04...

0 new messages