Hello!
I'm newbie using NHibernate, and my app is using lots of memory.
I have only about 20 class mapped, and the DB don't have more than a
thousand in those tables.
And my app pool is using more than 90 mb...
I'm using this class to load the nhibernate:
---------------
public sealed class NHibernateHelper : INhibernateHelper
{
private const string CurrentSessionKey =
"nhibernate.current_session";
private static readonly ISessionFactory sessionFactory;
static NHibernateHelper() {
Configuration cfg = new Configuration();
cfg.Configure();
//mappings
cfg.AddAssembly("persistencia");
sessionFactory = cfg.BuildSessionFactory();
}
public static ISession GetCurrentSession() {
HttpContext context = HttpContext.Current;
ISession currentSession = context.Items[CurrentSessionKey] as
ISession;
if ( currentSession == null ) {
currentSession = sessionFactory.OpenSession();
context.Items[CurrentSessionKey] = currentSession;
}
return currentSession;
}
public static void CloseSession() {
HttpContext context = HttpContext.Current;
ISession currentSession = context.Items[CurrentSessionKey] as
ISession;
if ( currentSession == null ) {
// No current session
return;
}
currentSession.Flush();
currentSession.Close();
context.Items.Remove(CurrentSessionKey);
}
---------------
Can someone help me? What am i doing wrong, that is making this memory
consumption...
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.