From: Warren Young Date: August 6 2009 9:52pm Subject: Re: Automatic Reconnect List-Archive: http://lists.mysql.com/plusplus/8698 Message-Id: <1B5D67DF-7338-4CC1-8087-E001ECC1D7B1@etr-usa.com> MIME-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Aug 6, 2009, at 3:42 PM, Dan Cook (dancook) wrote: > The rub comes from connections that have not expired in the pool > after a > server restart - the next grab will fail (I just tested this using > gdb). > I don't think there is anything a programmer can do about this except > retry. Yes. Even ping-on-grab() isn't 100% foolproof, as the DB server or network link could bounce between a successful ping and the query. So, if you either need a bulletproof system or these are common cases for you, you still need connection retry logic. > But then how do you purge (expire) all the connections in the > pool to get them to reset and do a fresh reconnect? Ping-on-grab() would handle that. I don't see a compelling reason to special-case this, dumping all the connections at once. Just handle it as part of your normal connection robustness assurance code.