예제 #1
0
 /// <summary>
 /// Helper method to wrap EntityConnection.ClearCurrentTransaction()
 /// </summary>
 private void ClearCurrentTransaction()
 {
     if (_connection.CurrentTransaction == this)
     {
         _connection.ClearCurrentTransaction();
     }
 }
예제 #2
0
        /// <summary>
        /// Releases the resources used by this transaction object
        /// </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)
            {
                if (!_isDisposed)
                {
                    _connection.ClearCurrentTransaction();

                    _entityTransaction.Dispose();

                    if (_shouldCloseConnection)
                    {
                        if (ConnectionState.Closed != _connection.State)
                        {
                            _connection.Close();
                        }
                    }

                    _isDisposed = true;
                }
            }
        }