What is WCF Durable Service? – Easy WCF
Skip to content

What is WCF Durable Service?

In This aticle, we will understand what is WCF Durable Service?

What is WCF Durable Service?

HTTP is a stateless protocol. So if we talk about web application, web service and WCF, all these technologies support HTTP. It means they are stateless or not able to persist the state of server object between multiple requests.

In WCF, durable services serves  this purpose means it provides a way to persist the instance of service object between multiple requests. Durable services persist the service object even after the service restarts.

How WCF Durable Service persists the instance?

Durable services serialize the instance of service object to XML and stores this XML in the database with a GUID as a unique key. Client sends this GUID to the service, service use this GUID to get the corresponding instance from database to serve that request.

We can also persist the Instance object in WCF using session state persistence asInstanceContextMode.PerSession.

The only difference is that session state persistence will persist the instance until service or client is restarted.

As session state persistence stores the instance in memory, so it will lose the object as client or server will restart. But durable service stores the instance in database and can get the instance from database using provided GUID even after the service is restarted. Now let’s have a look at the implementation of durable service in WCF.

 

You may also like:

Create WCF Durable service

Test WCF durable service

© 2015, admin. All rights reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *