Search code examples
c#wcfravendbsession-management

Raven DB session management in WCF


I have a WCF service that accepts requests, performs some work and saves result to Raven DB. I am thinking that the session management shall be similar to NHibernate with WCF, but I am not sure. Currently I am thinking of creating one session per WCF request.

Any other recomendations?


Solution

  • Yes, from session management perspective, you can use all the NHibernate practices. So session management for RavenDB in WCF is identical to how you do that with NHibernate

    In concrete terms, that means using a per call instance mode and creating the session before the call and calling SaveChanges() and dispose after the call.