List:MySQL++« Previous MessageNext Message »
From:Izzy Date:September 26 2008 1:20pm
Subject:possible bug
View as plain text  
Hi

I would like to notice some problems with connection creating. I had
some problems with implemented connection pool (that is another
problem), so
I made one myself.
I declared
mysqlpp::Connection *pCon;

and tried
pCon = new mysqlpp::Connection[ 20 ];

everything linked normally without problems.
But when I looped and tried to connect every connection, I got bunch
of catched exceptions, like MySql gonne away, and similar.

After days of experimenting what may be wrong, I found the solution. I
need to declare array of pointers, then create every of them
with default constructor set to true or false.
like mysqlpp::Connection *pCon[ 20 ];
for(int i = 0; i< 20; i++)
  pCon[i] = new mysqlpp::Conneciton(false);

So the main problem is that when you declare connection without
constructor, it is impossible to connect.
At lest this happens on my Windows machine, I didn't have possibility
to try on another platform.
Thread
possible bugIzzy26 Sep
  • Re: possible bugMickaël Wolff26 Sep
  • Re: possible bugMickaël Wolff26 Sep
    • Re: possible bugIzzy28 Sep
  • Re: possible bugEric Woo27 Sep
  • Re: possible bugChris Frey28 Sep