Leonardo Lima
unread,Aug 1, 2011, 11:54:34 AM8/1/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to uNhAddIns
Hi all,
I´m trying to use the MultiSessionFactoryProvider, I already did the
project build correctly, but now I´m getting the following error:
{"No CurrentSessionContext configured (set the property
current_session_context_class)!"}
this error throws here (on class NHExtendedSessionWebModule):
foreach (ISessionFactory factory in sfp)
{
factory.GetCurrentSession().BeginTransaction();
}
I´ve downloaded the project uNhAddIns, and copied the classes that I
wanted use to my project and their dependencies, I just change one
thing that is the way to build a new ISession, because now I´m using
Fluent NHibernate....
Mine Ninject part code
kernel.Bind<ISessionFactoryProvider>().To<MultiSessionFactoryProvider>().InSingletonScope();
kernel.Bind<ISessionFactory>().ToMethod(x =>
x.Kernel.Get<ISessionFactoryProvider>().GetFactory("SessionFactory_Site"))
.InSingletonScope()
.Named("SessionFactorySite");
protected override void OnApplicationStarted()
{
RegisterRoutes(RouteTable.Routes);
Kernel.Get<MultiSessionFactoryProvider>().Initialize();
Application[Commons.SessionFactoryProviderKey] =
Kernel.Get<MultiSessionFactoryProvider>();
}