Application.Lock - allows read??

  • Thread starter Thread starter Eidolon
  • Start date Start date
E

Eidolon

Quick question about Application.Lock()...

When you lock the application, does it still allow read access, or does it
deny read as well as write?

thanks in advance,

- Aaron.
 
Hi,
The Lock method blocks other clients from modifying the
variables stored in the Application object, ensuring that
only one client at a time can alter or access the
Application variables.

regards
Sreejumon[MVP]
www.mstechzone.com
 
It still allows read access while it is locked. The lock only applies to
writing data to the application object.
I'm pretty sure the reads will continue to get the old application value
until you unlock.
 
Sreejumon is a smart guy and made me doubt myself on this one. So I looked
it up on the Internet and I still can't say I'm sure one way or another. I
saw a couple web sites that agreed with what Sreejumon pasted, then I also
saw some sites that did not. And I saw others that weren't specific about
that detail.
Here's more info:
http://www.devguru.com/Technologies/asp/quickref/application_lock.html
http://webcoder.info/reference/Application.Lock.html
http://www.piclist.com/techref/language/asp/obj/ref_vbom_apoml.htm

Has anybody personally tested this situation to be sure?
 
Steve,

I just tested it like this:

If Not IsPostBack Then

'---First page load only

Application("Test") = 1

Response.Write(Application("Test").ToString)

Else

'---Post back only

Application.Lock()

Application("Test") = 2

Response.Write(Application("Test").ToString)

End If

The application object is still readable (of course) and on post back it
returned as: 2



Sincerely,


--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top