2

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?

oleksii
  • 35,458
  • 16
  • 93
  • 163

2 Answers2

2

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.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
0

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.

BrandonZeider
  • 8,014
  • 2
  • 23
  • 20
  • Once I get a request I save it to db and update its status depending on the progress. Lastly, I update the final request status and attach the result csv file produced by the request. It seems like per-call (per-request) session management is the optimal option. Thanks! – oleksii Apr 28 '11 at 13:35