Exemple #1
0
        private static void Application_EndRequest(object sender, EventArgs e)
        {
            NHibernateSession.CloseAllSessions();

            var context = HttpContext.Current;

            context.Items.Remove(HttpContextSessionStorageKey);
        }
Exemple #2
0
 public void EndUnitOfWork(bool closeSessions)
 {
     if (closeSessions)
     {
         NHibernateSession.CloseAllSessions();
         this.perThreadSessionStorage.Remove(this.GetCurrentThreadName());
     }
     else
     {
         foreach (var session in this.GetAllSessions())
         {
             session.Clear();
         }
     }
 }
Exemple #3
0
        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();
        }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
 public virtual void TearDown()
 {
     NHibernateSession.CloseAllSessions();
     NHibernateSession.Reset();
 }
Exemple #6
0
 public static void Shutdown()
 {
     NHibernateSession.CloseAllSessions();
     NHibernateSession.Reset();
 }
 private void Shutdown()
 {
     NHibernateSession.CloseAllSessions();
     NHibernateSession.Reset();
 }
Exemple #8
0
 public void BeforeSendReply(ref Message reply, object correlationState)
 {
     NHibernateSession.CloseAllSessions();
 }
 public virtual void Application_End(Object sender, EventArgs e)
 {
     NHibernateSession.CloseAllSessions();
     _container.Dispose();
 }