I was thinking the Mysql++ api was thread safe because the database
system is using lock's himself and because of other opionion I have read
about connection pooling.
Reading the documentation it is written that when sharing a connection
between threads we have to lock the connection between
Mysql_query() and mysql_store_result() witch mean we have to wait after
the full query completion and data transfer, it is then clear that
sharing connection is not interesting since one slow query could
interfere with another quick query (that may normally not be affected by
I have to conclude that Mysql++ is not efficient with threading while
sharing connection, I hope I misunderstand something?
Or is there another way around?
From: Warren Young [mailto:mysqlpp@stripped]
Sent: September 19, 2006 11:59 AM
To: MySQL++ Mailing List
Subject: Re: Connection sharing vs lost of query per connections
Julien Chavanton wrote:
> I think my problem was
> mysql_ping() after reading the description again I found that we must
> use this only when there was a significant idle period and not every
> query like I was doing.
Yes. While a ping is the least expensive round-trip call you can have
to the database, it's still expensive in terms of local CPU time.
> I guess the normal behaviour is to wait after an error and then
> reconnect if possible?
There's a MySQL connection option to make the library try to reconnect
automatically. This was covered just days ago. Search the list.
You should still write your code with an awareness that a connection
could fail, however. Networks break, servers die.
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus