pqxx を使用して psql データベースへの接続の配列を作成すると、接続が正常に作成され、それらが配列に含まれます。しかし、1 つの接続を使用しようとすると、次のエラーが表示されます。配列を作成した方法も以下に記載されています。この理由を誰か教えてください。
for(int i=0;i<10;i++)
{
connection c("dbname=test user=postgres password=abc123\
hostaddr=127.0.0.1 port=5432");
conList[i]=&c;
}
for (int j=0;j<10;j++)
{
cout<<conList[j]->is_open()<<endl; // this returns 0
}
conList[0]->activate(); // at this point it gives the following error
'pqxx::broken_connection' what() のインスタンスをスローした後に呼び出された終了: データベースへの接続に失敗しました 中止されました