Question

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?

Was it helpful?

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.

OTHER TIPS

Well it's really going to depend on your use case, but for the best scalability you should give preference to the per-call instance mode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top