Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 1.2.1
Is this class working under 1.2.1
I am doing following in Application_BeginRequest
Code:
if (ManagedWebSessionContext.HasBind(HttpContext.Current, NHibernateHelper.SessionFactory))
{
ManagedWebSessionContext.Unbind(HttpContext.Current, NHibernateHelper.SessionFactory);
}
ManagedWebSessionContext.Bind(HttpContext.Current,
NHibernateHelper.SessionFactory.OpenSession());
however, when I try to do something like this
Code:
return(EntityBag<T>) NHSession.CreateCriteria(typeof(T)).List<T>();
it tells me that
Code:
[HibernateException: No session bound to the current context]
NHibernate.Context.CurrentSessionContext.CurrentSession() +92
NHibernate.Impl.SessionFactoryImpl.GetCurrentSession() +94
Intelliun.NHibernateExtensions.NHibernateHelper.GetCurrentSession() in C:\VE4_0\server\namespace\homes\Web\codegen\Demo\NhibernateSessionModule\NHibernateHelper.cs:43
Intelliun.Data.Repositories.GenericRepository.get_NHSession() in C:\VE4_0\server\namespace\homes\Web\codegen\Demo\Intelliun.Data\Repositories\Base\GenericRepository.cs:30
Intelliun.Data.Repositories.GenericRepository.FindAll() in C:\VE4_0\server\namespace\homes\Web\codegen\Demo\Intelliun.Data\Repositories\Base\GenericRepository.cs:79