From: Bill K Date: January 17 2007 3:24pm Subject: Re: Lost connection to MySQL server during query List-Archive: http://lists.mysql.com/plusplus/6296 Message-Id: <45AE3FAF.2060300@billism.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello Roger, I also have this problem, in a mult-threaded environment as you described. I searched for a solution all over and went through all the possibilities found on the mysql web site and others. It is definitely not a timeout, as is said to be the most common reason for this exception. I found no solution. The work-around that I did was code the app to call ping() on the connection object after that exception was thrown and then put the query back in the query queue I have setup, which is then promptly processed just fine. I even use the 'reconnect' and 'multi_statement' (needed anyway for stored procedures) options. ping() will test and reconnect the connection. Not a fix by any means but at least it gets the job done, and just ever so slightly slower, as like you said, it happens every 50 or 100 queries or so. Note: Using MySql 5.20 and the release of MySql++ 2.1.1. If I remember correctly, this problem started happening when I started using stored procedures. - Bill K. Urscheler, Roger (COM Chantry CA) wrote: > Hi, > > I have a multi-threaded application with a threadpool where each thread has > its own connection (and query and row objects). I did set the 'reconnect' > and 'multi statement' options. Once a while (about every 50 or 100 queries) > the connection to mysql is disconnected, the exception is "Lost connection > to MySQL server during query". The 'reconnect' option reconnects > automatically again, but still this query failed. > > Does anybody know about this problem? > > Thanks, > Roger > > >