From: Johan De Meersman
Date: May 13 2011 10:59am
Subject: Re: problem
List-Archive: http://lists.mysql.com/mysql/224997
Message-Id: <60ec0064-a3f4-41c7-8289-44bf5a9cd5a2@zimbra>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
----- Original Message -----
> From: "Gavin Towey"
>
> The server will disconnect idle connections after a while. The
> wait_timeout variable controls how many seconds it will wait. You
> can set it for your connection when you connect by issuing a query
> like:
>
> SET SESSION wait_timeout=NNN;
>
> Just give it a large enough value.
That will, of course, work; but it has as side effect that improperly terminated connections (application crash, ...) will stay around for that time, too.
It is better to have your connection (-pooling) code be aware of connection timeouts, and have it transparantly reconnect. If I recall correctly, the client library has a ping() function or something similar.
--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel