/// <summary> /// Used to execute internal commands. /// </summary> internal NpgsqlCommand(string cmdText, NpgsqlConnector connector) { parameters = new NpgsqlParameterCollection(); planName = string.Empty; text = cmdText; this.m_Connector = connector; type = CommandType.Text; // Removed this setting. It was causing too much problem. // Do internal commands really need different timeout setting? // Internal commands aren't affected by command timeout value provided by user. // timeout = 20; }
/// <summary> /// Initializes a new instance of the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> class with the text of the query, a <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see>, and the <see cref="Npgsql.NpgsqlTransaction">NpgsqlTransaction</see>. /// </summary> /// <param name="cmdText">The text of the query.</param> /// <param name="connection">A <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> that represents the connection to a PostgreSQL server.</param> /// <param name="transaction">The <see cref="Npgsql.NpgsqlTransaction">NpgsqlTransaction</see> in which the <see cref="Npgsql.NpgsqlCommand">NpgsqlCommand</see> executes.</param> public NpgsqlCommand(String cmdText, NpgsqlConnection connection, NpgsqlTransaction transaction) { parameters = new NpgsqlParameterCollection(); planName = String.Empty; text = cmdText; this.connection = connection; if (this.connection != null) { this.m_Connector = connection.Connector; } type = CommandType.Text; this.Transaction = transaction; SetCommandTimeout(); }