예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
                }
            }
        }
예제 #3
0
        /// <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;
            }
        }