wcfnhibernatenhibernate-3

NHibernate + WCF + Windows Service and WcfOperationSessionContext class


So my guestions are:

WcfOperationSessionContext (hibernate 3.0) class?

how to use it with WCF?

Well to make it concrete :

Suppose that i have WCF Service called DataServices

class WCFDataService .....
{

   void SaveMyEntity(MyEntity entity)
    {



         .....................?? // How to do? Best Way

         // Should i take one session  and use it all times
         // Should i take session and dipsose when operation finished then get 
         //new session for new operations?
         // If many clients call my WCF service function at the same time?
         // what may go wrong?
         // etc....


     }


 }

And I need a NHibernateServiceProvider class

class NHibernateServiceProvider ....
{

    // How to get Session ?? Best way

     ISession GetCurrentSession(){.... }
     DisposeSession(){ ....}
}

Best Wishes

PS: I have read similiar entries here and other web pages. But can not see "concrete" answers.


Solution

  • Here is a post describing, in detail, all the steps for registering and using the WcfOperationSessionContext. It also includes instructions for using it with the agatha-rrsl project.