This project has moved. For the latest updates, please go here.

Unity.WCF + ThreadLifeTimeManager

Nov 16, 2012 at 4:32 PM

I am using Unity.WCF and I want one object per request, intially I thougth thread life time manager is meant for this. However later I realized that threads are kept alive by WCF framework to provide better performance. Now I am stuck how to acheive the same. I know its not directly related to Unity.WCF project here. I am posting it to get help as I think this is perfect place to ask this question instead of social.msdn.

I read the following article and solution provided in it for the problem I am facing.

http://blogs.msdn.com/b/atoakley/archive/2010/12/29/unity-lifetime-managers-and-wcf.aspx

Now I am wondering how can I plug in with Unity.WCF?

Thanks

Rohit

 

Coordinator
Feb 6, 2013 at 2:52 PM
You can use the HierarchicalLifetimeManager. This will act as a singleton per request and will also dispose of any components implementing IDisposable at the end of each request.
Dec 8, 2013 at 11:10 PM
I would like an example on how to implement using HierarchicalLifetimeManager, is there any on the web you could point out?

Thanks in advance.

Carlos Adriano Portes