Hi,
Im writing a web app and so far im using global variables although im not sure this is the best way to go, is it possible while using global variables for more than one user to access the same object??
Thanks
Chris
Printable View
Hi,
Im writing a web app and so far im using global variables although im not sure this is the best way to go, is it possible while using global variables for more than one user to access the same object??
Thanks
Chris
I'm kinda a newbie as well, so forgive the question if it's dumb; but will global variables even hold their value when a new page is loaded? You may not have any choice but to use session variables.
I will follow to see if anyone answers your question.
Ooogs
You have two sets of objects that can store data across page calls. Session variables, which are user specific, and Application variable which all sessions can see. If the data is user specific, stick with the Session. If it is something all users need to use (I've seen forum apps that store configuration data this way) then use the Application object.
Are we talking about a variable in a Module? Is that what you mean by global variable? Also is that what you mean by Application variable, techgnome?
You have to be aware of concurrency issues when using an instance of the HTTPApplicationState object (Application). Theoretically, two pages, for instance, could access the same object from the global dictionary and make updates, canceling out the other page's update. One way around this is by using the 'Application.Lock --- Application.Unlock' methods, whenever your code makes a change to the object. However, this will adversly affect application performance and open up doors for potential deadlocks.Quote:
Im writing a web app and so far im using global variables although im not sure this is the best way to go, is it possible while using global variables for more than one user to access the same object??
But, if all your objects are readonly, then you should be fine.