Skip to content

Test in having a singleton manage state for locking a client account for processing in a web service

Notifications You must be signed in to change notification settings

codereflection/clientAccountLocking

Repository files navigation

Test in having a singleton manage state for locking
a client account for processing in a web service.

A client account is just a simple class with an id.

The idea is that only one web service call can process
a given client account at a time. If a second call to 
a web service method is made, an exception should be 
thrown stating that the client account is already locked
for processing.

To see the client account lock working, invoke the 
ModifyClientAccount method twice on WebService1 with
the same id. The second call will throw an exception
stating that the client account is already locked, while
the first request processes for 10 seconds.

Syntax:

using (var lockedClientAccount = new ClientAccountLock(123))
{
	// work with the client account here
}

About

Test in having a singleton manage state for locking a client account for processing in a web service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published