I tried removing the [Serializable] attribute from the ApplicationServer, but it still throws the same exception. :cry:
What I need to know is how should I plug Nhibernate with .NET Remoting so that the Broker can be serialized and know a SessionFactory to be able to repair the session.
The client needs to obtain the ApplicationServer via remoting (service layer) and invoke the method ApplicationServer.CreateBOBroker();
Code:
public BOBroker CreateBOBroker()
{
return (new BOBroker(this.SessionFactory));
}
In order to be able to repair the Nhibernate Session the BOBroker needs the SessionFactory.
My BOBroker is a class that wraps the behaviour of ISession and adds other business logic.
Code:
public void OpenSession()
{
this.Session = this.SessionFactory.OpenSession();
}
public void CloseSession()
{
this.Session.Close();
}
public void RepairSession()
{
this.CloseSession();
this.OpenSession();
}
Any ideas, are welcome. :D
Thanks