Application.Lock - allows read??

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.
 
S

Sreejumon[MVP]

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
 
S

Steve C. Orr, MCSD

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.
 
S

Steve C. Orr, MCSD

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?
 
S

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top