<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Checking for a live database connection considered harmful</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/</link>
	<description>Percona&#039;s MySQL &#38; InnoDB performance and scalability blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:45:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Bottomless</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-767865</link>
		<dc:creator>Bottomless</dc:creator>
		<pubDate>Sat, 26 Jun 2010 05:36:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-767865</guid>
		<description>Shouldn&#039;t there be some sort of sleeping introduced in the code? If so for how long? (or better a back-off algorithm as suggested by &quot;J&quot;)

Otherwise it will just result in a storm of queries in a very short period of time, not allowing the system to recover from probably a temporary overload (and probably adding to the overload too) that caused the first query to fail in the first place.

Thanks</description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t there be some sort of sleeping introduced in the code? If so for how long? (or better a back-off algorithm as suggested by &#8220;J&#8221;)</p>
<p>Otherwise it will just result in a storm of queries in a very short period of time, not allowing the system to recover from probably a temporary overload (and probably adding to the overload too) that caused the first query to fail in the first place.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sys</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763958</link>
		<dc:creator>sys</dc:creator>
		<pubDate>Sat, 15 May 2010 09:56:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763958</guid>
		<description>The Oracle database adapter shipped with the Sun (now Oracle) Java CAPS (Composite Application Platform System) actually used to get a sorted list of users in the database, for checking if a connection is alive.

After much frantic yelling at Support we got it down to _merely_ doing something similar to select 1 from dual.</description>
		<content:encoded><![CDATA[<p>The Oracle database adapter shipped with the Sun (now Oracle) Java CAPS (Composite Application Platform System) actually used to get a sorted list of users in the database, for checking if a connection is alive.</p>
<p>After much frantic yelling at Support we got it down to _merely_ doing something similar to select 1 from dual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baron Schwartz</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763897</link>
		<dc:creator>Baron Schwartz</dc:creator>
		<pubDate>Sat, 15 May 2010 08:09:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763897</guid>
		<description>Syd, that&#039;s not true.  See above about &quot;common case.&quot;  If the uncommon case (a dead connection) is rare, which it should be, then a &quot;heavy exception&quot; that happens once in a few million queries is going to be a lot cheaper than a &quot;cheap check&quot; that happens once every query.</description>
		<content:encoded><![CDATA[<p>Syd, that&#8217;s not true.  See above about &#8220;common case.&#8221;  If the uncommon case (a dead connection) is rare, which it should be, then a &#8220;heavy exception&#8221; that happens once in a few million queries is going to be a lot cheaper than a &#8220;cheap check&#8221; that happens once every query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Syd</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763755</link>
		<dc:creator>Syd</dc:creator>
		<pubDate>Sat, 15 May 2010 05:14:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763755</guid>
		<description>Depends on the actual implementation &amp; overhead. It may or may not be faster to manually check rather than relying on an exception, which can be heavy, depending on your platform.</description>
		<content:encoded><![CDATA[<p>Depends on the actual implementation &amp; overhead. It may or may not be faster to manually check rather than relying on an exception, which can be heavy, depending on your platform.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haile</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763753</link>
		<dc:creator>Haile</dc:creator>
		<pubDate>Sat, 15 May 2010 05:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763753</guid>
		<description>Yes, this is a general principle that applies outside databases. Checking whether a file exists before trying to open it is the classic example of LBYL and has the same problems as the database example.</description>
		<content:encoded><![CDATA[<p>Yes, this is a general principle that applies outside databases. Checking whether a file exists before trying to open it is the classic example of LBYL and has the same problems as the database example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brigham</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763645</link>
		<dc:creator>Brigham</dc:creator>
		<pubDate>Fri, 14 May 2010 23:08:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763645</guid>
		<description>Thanks for the interesting article, especially the info about what goes on in the server when you make a check. I think the check at any point is really useless for the most part. I would not perform a retry either because if the connection is down something is really wrong. I would report the error back to the consumer of the query and let it decide how to handle.</description>
		<content:encoded><![CDATA[<p>Thanks for the interesting article, especially the info about what goes on in the server when you make a check. I think the check at any point is really useless for the most part. I would not perform a retry either because if the connection is down something is really wrong. I would report the error back to the consumer of the query and let it decide how to handle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Waldo Jaquith - links for 2010-05-14</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763644</link>
		<dc:creator>Waldo Jaquith - links for 2010-05-14</dc:creator>
		<pubDate>Fri, 14 May 2010 23:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763644</guid>
		<description>Baron Schwartz: Checking for a live database connection considered harmful Baron explains why checking for a working DB connection at the head of your code in website development is actually a pretty bad idea. And I&#039;ll be damned if he&#039;s not right. I&#039;ve been doing this for years, but I&#039;ll stop now. (tags: mysql php programming database)</description>
		<content:encoded><![CDATA[<p>Baron Schwartz: Checking for a live database connection considered harmful Baron explains why checking for a working DB connection at the head of your code in website development is actually a pretty bad idea. And I&#39;ll be damned if he&#39;s not right. I&#39;ve been doing this for years, but I&#39;ll stop now. (tags: mysql php programming database)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763599</link>
		<dc:creator>Jay</dc:creator>
		<pubDate>Fri, 14 May 2010 20:52:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763599</guid>
		<description>Roland,

He does retry to connect as many times as specified in the parameter.
Because of the while loop it will try to reconnect and requery</description>
		<content:encoded><![CDATA[<p>Roland,</p>
<p>He does retry to connect as many times as specified in the parameter.<br />
Because of the while loop it will try to reconnect and requery</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott S. McCoy</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763596</link>
		<dc:creator>Scott S. McCoy</dc:creator>
		<pubDate>Fri, 14 May 2010 20:50:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763596</guid>
		<description>I would consider this type of continual query attempt to be harmful in many instances.  I prefer that applications simply error if the connection becomes stale or breaks â€” I would like not to have partial and corrupt data in most instances.</description>
		<content:encoded><![CDATA[<p>I would consider this type of continual query attempt to be harmful in many instances.  I prefer that applications simply error if the connection becomes stale or breaks â€” I would like not to have partial and corrupt data in most instances.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: developingElegance();</title>
		<link>http://www.mysqlperformanceblog.com/2010/05/05/checking-for-a-live-database-connection-considered-harmful/comment-page-1/#comment-763595</link>
		<dc:creator>developingElegance();</dc:creator>
		<pubDate>Fri, 14 May 2010 20:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=2583#comment-763595</guid>
		<description>&lt;strong&gt;Don&#8217;t check for a live database connection...&lt;/strong&gt;

Baron Schwartz from the MySQL Performance Blog chimes in with a great point on reducing the load on your MySQL server &#8211; use a try / catch functionality instead of an if statement to figure out if you&#8217;re going to have a problem with the Â MyS...</description>
		<content:encoded><![CDATA[<p><strong>Don&#8217;t check for a live database connection&#8230;</strong></p>
<p>Baron Schwartz from the MySQL Performance Blog chimes in with a great point on reducing the load on your MySQL server &#8211; use a try / catch functionality instead of an if statement to figure out if you&#8217;re going to have a problem with the Â MyS&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

