How do I prevent concurrent access to my web service. How to avoid it.
Hi Leo,
If you want to have only one caller at a time, you could create a singleton
that keeps track of how many callers are in call, and have any web method
then increment the count (lock here) check that count, and if it is > 1
with the lock still active, decrement, unlock and then throw an exception.
It is most unusual to expose this kind of requirement via web service, at
least this is the first request of this nature I've seen. The reason is
that if there are multiple callers, there is no way to gate who calls when,
so I'd expect the client satisfaction to be pretty low on this approach.
Why do you want to impose this kind of limit?
I hope this helps
Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: prevent concurrent access to my web service
thread-index: AcTcUwc1ODEDrwE8QwK35DLOPgw5gg==
X-WBNR-Posting-Host: 203.197.160.37
From: =?Utf-8?B?TGVv?= <Leo@discussions.microsoft.com>
Subject: prevent concurrent access to my web service
Date: Tue, 7 Dec 2004 03:51:03 -0800
Lines: 3
Message-ID: <EB080F38-1A53-4983-9C2F-198875DDE720@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA
03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:5063
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements
How do I prevent concurrent access to my web service. How to avoid it.

Signature
Leo