ConcurrencyMode-WCF

Concurrency mode helps us configure allowed number of concurrent calls for a service. This can be enabled by using a class level attribute Service Behavior. Concurrency mode property supports 3 values.

  1. Single, 2. Multiple and 3. Reentrant

ConcurrencyMode

Single: System restricts instance creations of the service to one thread of execution at a time.

Multiple: This enables system to execute server objects in multiple threads at any one time. We should ensure thread safety.

Reentrant: Enables us to restrict server object to process operations at a time. If any other object is leaves the operation, this frees up the lock on the operation, so the current process can enter the operation execution.

When Concurrency Mode is set to we need to maintain user state at client state. This is achieved by setting session mode property to require. Also we need to set IsInitiating and Isterminating properties to true at the operation contract level.

sessionmode

IsInitiating property allows system to create a session and Isterminating property allows us to forcefully close the session.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s