void IDisposable.Dispose() { if (_dataConnection != null) { if (_dataConnection.QueryHints.Count > 0) { QueryHints.AddRange(_queryHints); } if (_dataConnection.NextQueryHints.Count > 0) { NextQueryHints.AddRange(_nextQueryHints); } _dataConnection.Dispose(); _dataConnection = null; } }
internal void ReleaseQuery() { if (_dataConnection != null) { if (LockDbManagerCounter == 0 && KeepConnectionAlive == false) { if (_dataConnection.QueryHints.Count > 0) { QueryHints.AddRange(_queryHints); } if (_dataConnection.NextQueryHints.Count > 0) { NextQueryHints.AddRange(_nextQueryHints); } _dataConnection.Dispose(); _dataConnection = null; } } }
/// <summary> /// Closes underlying connection and fires <see cref="OnClosing"/> event (only if connection existed). /// </summary> void Close() { if (_dataConnection != null) { if (OnClosing != null) { OnClosing(this, EventArgs.Empty); } if (_dataConnection.QueryHints.Count > 0) { QueryHints.AddRange(_queryHints); } if (_dataConnection.NextQueryHints.Count > 0) { NextQueryHints.AddRange(_nextQueryHints); } _dataConnection.Dispose(); _dataConnection = null; } }