private static void Application_EndRequest(object sender, EventArgs e) { NHibernateSession.CloseAllSessions(); var context = HttpContext.Current; context.Items.Remove(HttpContextSessionStorageKey); }
public void EndUnitOfWork(bool closeSessions) { if (closeSessions) { NHibernateSession.CloseAllSessions(); this.perThreadSessionStorage.Remove(this.GetCurrentThreadName()); } else { foreach (var session in this.GetAllSessions()) { session.Clear(); } } }
static void Main() { InitNHibernate(); InitServiceLocator(); Console.WriteLine("Connections initialized. What would you like to do?"); Console.WriteLine("[D]emo Environment Setup"); Console.WriteLine("[U]ser Interface Testing Setup"); Console.WriteLine("[Q]uit"); Console.WriteLine("Press a key..."); bool validKey = false; while (!validKey) { string key = Console.ReadKey().Key.ToString().ToLower(); switch (key) { case "d": validKey = true; SetupDemoSite(); break; case "u": validKey = true; SetupInterfaceTestSite(); break; case "q": validKey = true; break; default: Console.Write("Invalid choice. Press a key..."); break; } } NHibernateSession.CloseAllSessions(); NHibernateSession.Reset(); }
public static void Main(string[] args) { Aplicacao.Boot(); Log.Initialize(); NHibernateSession.CloseAllSessions(); UnidadeDeTrabalho.Boot(); Log.App.Info("Aplicacao Iniciada"); if (!Environment.UserInteractive) { using (var service = new ServiceRunner()) { ServiceBase.Run(service); } } else { Start(args); } }
public virtual void TearDown() { NHibernateSession.CloseAllSessions(); NHibernateSession.Reset(); }
public static void Shutdown() { NHibernateSession.CloseAllSessions(); NHibernateSession.Reset(); }
private void Shutdown() { NHibernateSession.CloseAllSessions(); NHibernateSession.Reset(); }
public void BeforeSendReply(ref Message reply, object correlationState) { NHibernateSession.CloseAllSessions(); }
public virtual void Application_End(Object sender, EventArgs e) { NHibernateSession.CloseAllSessions(); _container.Dispose(); }