title: Check a Connection is still active or not in libpqxx (postgres)
body: <p>How can I check a particular connection has finished it's job or still active in postgres?
  I'm creating an array of connections to my database and I want to get a connection which is not in any transaction. I'm using C++ and libpqxx library to connect the database. Can any one tell me how can I check this. </p>
  
  <p>I want to do something like this,</p>
  
  <pre><code> connection* conList;
      for(int i=0;i&lt;10;i++)
          {
              conList[i]=new connection("dbname=test user=postgres password=abc123 hostaddr=127.0.0.1 port=5432");
          }
  
      int i=0;
      while(true)
      {
        if(conList[i] has not any active transaction )
        {
         //do something   
        }
       i++;
      }
  </code></pre>