From: Warren Young Date: September 19 2006 3:59pm Subject: Re: Connection sharing vs lost of query per connections List-Archive: http://lists.mysql.com/plusplus/5945 Message-Id: <451013D9.4060502@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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.