/// <summary> /// Libera a instancia. /// </summary> /// <param name="disposing"></param> public virtual void Dispose(bool disposing) { if (_state == GDASessionState.Open) { DisposeCurrentTransaction(disposing); if (_currentConnection != null) { try { if (_currentConnection != null) { _currentConnection.Close(); } } catch { } try { if (_currentConnection != null) { _currentConnection.Dispose(); } } catch { } } CurrentTransaction = null; _currentConnection = null; _state = GDASessionState.Closed; } _isDisposed = true; }
/// <summary> /// Fecha a sessão. /// </summary> public void Close() { if (_state == GDASessionState.Open) { if (CurrentTransaction != null) { CurrentTransaction.Dispose(); } _currentConnection.Close(); _currentConnection.Dispose(); CurrentTransaction = null; _currentConnection = null; _state = GDASessionState.Closed; } }