<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hank Beaver &#187; activerecord</title>
	<atom:link href="http://www.hankbeaver.com/index.php/category/activerecord/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hankbeaver.com</link>
	<description>Ruby, open-source, Internet technologist located in Atlanta, GA, USA</description>
	<lastBuildDate>Tue, 29 Jun 2010 05:34:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mysql::Error: MySQL server has gone away with Sinatra + ActiveRecord</title>
		<link>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/</link>
		<comments>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 17:17:12 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[activerecord]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[thin]]></category>

		<guid isPermaLink="false">http://www.rubyslacker.com/?p=98</guid>
		<description><![CDATA[When working with Sinatra + ActiveRecord + MySQL running on the venerable Thin server, you are probably going to see the error after 8 hours(MySQL default connection timeout):  &#8220;Mysql::Error: MySQL server has gone away&#8221; message. The resolution is pretty simple: 

class NewApp < Sinatra::Default   

  before do
    ActiveRecord::Base.connection.verify!
 [...]]]></description>
			<content:encoded><![CDATA[<p>When working with Sinatra + ActiveRecord + MySQL running on the venerable <a href="http://code.macournoyer.com/thin/">Thin</a> server, you are probably going to see the error after 8 hours(MySQL default connection timeout):  &#8220;Mysql::Error: MySQL server has gone away&#8221; message. The resolution is pretty simple: </p>
<pre>
class NewApp < Sinatra::Default   

  before do
    ActiveRecord::Base.connection.verify!
  end
...
end #end of Sinatra class
</pre>
<p>I created a Lighthouse ticket before I discovered the resolution. There are also more technical details here: <a href="https://thin.lighthouseapp.com/projects/7212-thin/tickets/101-activerecord-connection-does-not-reconnect-when-using-thinsinatra-but-works-fine-with-just-sinatra#ticket-101-4">https://thin.lighthouseapp.com/projects/7212-thin/tickets/101-activerecord-connection-does-not-reconnect-when-using-thinsinatra-but-works-fine-with-just-sinatra#ticket-101-4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
