Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Application.Lock()/UnLock() or lock(Application)

Reply
Thread Tools

Application.Lock()/UnLock() or lock(Application)

 
 
nano2k
Guest
Posts: n/a
 
      07-23-2007
Hello

Is there a difference between:

1.
Application.Lock();
try {
//...code
}
finally {
Application.UnLock();
}

pattern and
2.
lock(Application) {
//...code
}

?

I read on MSDN (http://support.microsoft.com/default.aspx/kb/271787)
that there are some situations when the first pattern blocks the
service.

Thanks.

 
Reply With Quote
 
 
 
 
Luis Ruiz Pavón
Guest
Posts: n/a
 
      07-24-2007
Hi:

The first pattern is only applied to application state in web applications
while second pattern is a rapid and easily implementation of Monitor (enter()
and exit()) class valid for many situations.

Sorry for my english!!!

Regards

--
Colabora con el foro: Si la respuesta te es de utilidad marca la pregunta
como respondida.
Luis Ruiz Pavón
MCP - MCTS
Blog: http://geeks.ms/blogs/lruiz



"nano2k" wrote:

> Hello
>
> Is there a difference between:
>
> 1.
> Application.Lock();
> try {
> //...code
> }
> finally {
> Application.UnLock();
> }
>
> pattern and
> 2.
> lock(Application) {
> //...code
> }
>
> ?
>
> I read on MSDN (http://support.microsoft.com/default.aspx/kb/271787)
> that there are some situations when the first pattern blocks the
> service.
>
> Thanks.
>
>

 
Reply With Quote
 
 
 
 
nano2k
Guest
Posts: n/a
 
      08-09-2007
On 24 Iul, 14:28, Luis Ruiz Pavn <(E-Mail Removed)> wrote:
> Hi:
>
> The first pattern is only applied to application state in web applications
> while second pattern is a rapid and easily implementation of Monitor (enter()
> and exit()) class valid for many situations.
>
> Sorry for my english!!!
>
> Regards
>
> --
> Colabora con el foro: Si la respuesta te es de utilidad marca la pregunta
> como respondida.
> Luis Ruiz Pavn
> MCP - MCTS
> Blog:http://geeks.ms/blogs/lruiz
>
>
>
> "nano2k" wrote:
> > Hello

>
> > Is there a difference between:

>
> > 1.
> > Application.Lock();
> > try {
> > //...code
> > }
> > finally {
> > Application.UnLock();
> > }

>
> > pattern and
> > 2.
> > lock(Application) {
> > //...code
> > }

>
> > ?

>
> > I read on MSDN (http://support.microsoft.com/default.aspx/kb/271787)
> > that there are some situations when the first pattern blocks the
> > service.

>
> > Thanks.- Ascunde citatul -

>
> - Afi are text n citat -


Thanks Luis for your response
What is your recommendation. Should we use pattern 1 or pattern 2?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments