public static void ForceCloseSession() { if (session != null) { CurrentSession.Close(); session = null; } }
/// <summary> /// Close current session /// </summary> public static void CloseSession() { _logger.Debug("Closing NHibernate session"); if (CurrentSession != null) { CurrentSession.Close(); CurrentSession = null; } }
public void CloseCurrentSession() { if (CurrentSession != null) { CurrentSession.Close(); CurrentSession.Dispose(); CurrentSession = null; } }
public static void ClearSession() { CurrentSession.Clear(); CurrentSession.Close(); CurrentSession.SessionFactory.Close(); CurrentSession.Dispose(); CurrentSession.SessionFactory.Dispose(); mSession = null; GC.Collect(); GC.WaitForPendingFinalizers(); }
/// <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; } }
public static void CloseSession() { if (session != null) { // CurrentSession.Disconnect(); if (!ReuseSession) { CurrentSession.Close(); session = null; } } }
public void Disconnect() { CurrentSession.Close(); }
/// <summary> /// 关闭会话 /// </summary> public override void SessionClose() => CurrentSession.Close(true);
/// <summary> /// 关闭当前会话 /// </summary> public virtual void CloseSession() { CurrentSession.Close(true); }