What you need to do is create a Singleton object and then lock that object.
That way even though users's might be calling the webservice at the same
time, the object would only allow itself to be called by one thread at a
time.
Google the "Singleton Pattern."
Shaun McDonnell
> Noob here,
>
[quoted text clipped - 24 lines]
>
> TIA
Greg Young - 29 Apr 2006 20:28 GMT
This will only work within the same worker process ..
If the webservice instances are all runnig in the same process you could
even just lock on the type to have synchronized behavior between multiple
instances.
Generally though webservices are run in a multiple process configuration
(i.e. multiple worker processes). In this case neither of the above
solutions will work as both are scoped to the process level.
If you are running multiple worker processes on the same machine you can use
a mutex
http://msdn2.microsoft.com/en-us/library/system.threading.mutex(VS.80).aspx
to synchronize all (including between processes)
If you are running multiple processes on multiple machines, you would need
to put up a manager process to manage the synchronization between them.
Cheers,
Greg
> What you need to do is create a Singleton object and then lock that
> object. That way even though users's might be calling the webservice at
[quoted text clipped - 33 lines]
>>
>> TIA
Shaun McDonnell - 29 Apr 2006 22:09 GMT
You are correct. A mutex would be the answer if you're web service spans
multiple w3wp.exe's.
Shaun McDonnell
> This will only work within the same worker process ..
>
[quoted text clipped - 56 lines]
>>>
>>> TIA