Link to home
Start Free TrialLog in
Avatar of Nabilbahr
NabilbahrFlag for United States of America

asked on

public declaration of a string value is not available for all web users

i declared a public value,  and from what i understand that any change on its value will apply the new value to all live users of that DLL file , but i tried to open many browser windows to the same page , it sometimes show the new value and sometimes not . i can't understand why the new value does not apply for all users
while it is declared as Public
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As a workaround, I suggest that you persist your global information on the server.  You can cache a simple string for a short duration in the Application object:

Application("MyString") = "Hello world"

You might consider backing that up with a database record or a text file, as you have little control over when the application object will expire.
Avatar of Nabilbahr

ASKER

i tried to use single threading, but the application has failed.
Can you also tell me what is the disadvantages of single threading, for example do errors on the single thread cause errors to all users on the same thread,
i see theat by default  it is appartment threading
Single threading can result in serious bottlenecks on the server.  You should use Apartment threading and make sure that the "Unattended execution" box is checked.  

See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/6d592697-d540-4948-86c3-deaebad5b2f5.asp for more information on threading models and IIS.  However, some threading models are not implemented in VB.

Creating Visual Basic COM Components for ASP
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/6d592697-d540-4948-86c3-deaebad5b2f5.asp