private NpgsqlConnection GetConnection()
		{
			if (_connection == null || (_connection.FullState & ConnectionState.Open) != ConnectionState.Open)
			{
				_connection = new NpgsqlConnection(_connectionString);
				_connection.Open();
				_closeConnectionRequired = true;
				return _connection;
			}
			else
			{
				return _connection;
			}
		}
Exemple #2
0
		/// <summary>
		/// Create a new connection based on this one.
		/// </summary>
		/// <returns>A new NpgsqlConnection object.</returns>
		public NpgsqlConnection Clone()
		{
			CheckNotDisposed();

			NpgsqlConnection C = new NpgsqlConnection(settings);

			C.Notice += this.Notice;

			if (connector != null)
			{
				C.Open();
			}

			return C;
		}