views:

36

answers:

1

Hi,

I know that this issue has been discussed but all answers seem to be quite outdated (back in 2008).

I have a perfectly well configured application architecture with Spring.NET DI and transaction management and NHibernate. Session management works well within my integration tests.

But: what is the best way to handle the NHibernate session within WCF?

Are there any new concepts, frameworks?

Best Max

A: 

I have implemented session/transaction management in WCF with the help of IDispatchMessageInspector. It allows you to react on events like Begin/End reqest.

I have wrote a blog post about it. Its in russian, but code is in c# :). I hope it will help you.

Also you can have a look at sharp architecture. They implemented session/transaction management for both mvc and wcf.

Sly