15

I am building a WCF application, using NHibernate for the persistence layer. A lot of documentation thats out there is about using NHibernate with ASP.NET applications. But very little on the best ways to manage NHibernate Sessions in a WCF application.

After reading up on Instance Management Techniques in WCF applications, I am going to use "per-call Services". Drawing parallel with ASP.NET, this is like opening NHibernate sessions on Application_BeginRequest and closing them on Application_EndRequest. Billy McCafferty's S#arp Architecture has a great example of doing this very elegantly. But I am finding it a little hard to use a similar concept in a WCF application.

Any code samples or pointers to blogs with examples, will be greatly appreciated.

Rohit Agarwal
  • 4,269
  • 3
  • 27
  • 22

2 Answers2

5

I found another good example -

http://realfiction.net/go/133

flq
  • 22,247
  • 8
  • 55
  • 77
Rohit Agarwal
  • 4,269
  • 3
  • 27
  • 22