Sunil
Sunil

Reputation: 21406

Application Scoped Variable in Classic ASP hosted on web farm?

I am using the following code in my global.asa Application_Start event. My question is, do I need to do anything special so this application variable is usable across a web farm, since my classic ASP app is hosted on a web farm?

Sub Application_OnStart
 companies.add "a", "Athens"
 companies.add "b", "Belgrade"
 companies.add "c", "Cairo"
 set Application("companies") = companies
End Sub

Upvotes: 1

Views: 655

Answers (1)

AnthonyWJones
AnthonyWJones

Reputation: 189457

Assumptions:

  1. you have simply forgotten to show the declaraion and assigning of an instance of an object to the companies variable.
  2. that this object is free-threaded but has the STA marshalling proxy needed to make objects in the Application object usuable.
  3. You are simply loading this object with cached data to improve performance. I.e., you aren't expecting to update it during processing of requests and have that data available to subsquent requests.

Where the above assumptions are all true then you are good to go. If any are false you have a problem.

If you have a problem with the first two then you have a problem with or without a web farm so you should be able to test that before depolyment.

If you have a problem with the third assumption then you are going to need the help of a backing DB, and some other plumbing.

Upvotes: 1

Related Questions