Ejemplo n.º 1
0
 public void DisposeSession()
 {
     if (CurrentSession != null)
     {
         CurrentSession.Dispose();
     }
 }
Ejemplo n.º 2
0
 private void RestartExecute()
 {
     CurrentSession?.Dispose();
     CurrentSession         = new SessionFacade();
     Page                   = new WelcomePage();
     CurrentSession.TimeUp += CurrentSession_TimeUp;
 }
Ejemplo n.º 3
0
 public void CloseCurrentSession()
 {
     if (CurrentSession != null)
     {
         CurrentSession.Close();
         CurrentSession.Dispose();
         CurrentSession = null;
     }
 }
Ejemplo n.º 4
0
 public static void ClearSession()
 {
     CurrentSession.Clear();
     CurrentSession.Close();
     CurrentSession.SessionFactory.Close();
     CurrentSession.Dispose();
     CurrentSession.SessionFactory.Dispose();
     mSession = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
Ejemplo n.º 5
0
        /// <summary>
        ///   Close the persistence session.
        /// </summary>
        public virtual void CloseSession()
        {
            if (!IsSessionOpened)
            {
                Log.Info("Closing MemoDb Session - Session is not open");
                return;
            }

            Log.Info("Closing MemoDb Session");
            CurrentSession.Dispose();
            CurrentSession = null;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Releases unmanaged and - optionally - managed resources
 /// </summary>
 /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing && CurrentSession != null)
     {
         if (CurrentSession.IsOpen)
         {
             CurrentSession.Close();
         }
         CurrentSession.Dispose();
         _disposed = true;
     }
 }
Ejemplo n.º 7
0
 public MvcApplication()
 {
     BeginRequest += (sender, args) => CurrentSession = SessionFactory.OpenSession();
     EndRequest   += (sender, args) => CurrentSession.Dispose();
 }
Ejemplo n.º 8
0
 public void Dispose()
 {
     CurrentSession.Transaction.Dispose();
     CurrentSession.Dispose();
 }
Ejemplo n.º 9
0
 public static void Shutdown()
 {
     CurrentSession.Dispose();
     CurrentStatelessSession.Dispose();
 }
Ejemplo n.º 10
0
 public void Dispose()
 {
     //Log.DebugFormat("Disposing {0}", GetHashCode());
     currentSession.Transaction.Dispose();
     CurrentSession.Dispose();
 }