<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Monkey patching ActiveRecord to automatically release connections</title>
	<atom:link href="http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/feed/" rel="self" type="application/rss+xml" />
	<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/</link>
	<description>pronounced &#34;coder&#34; not &#34;code err&#34; (extended r optional)</description>
	<lastBuildDate>Sun, 20 Dec 2009 10:03:37 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: coderrr</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1685</link>
		<dc:creator>coderrr</dc:creator>
		<pubDate>Mon, 06 Jul 2009 20:06:49 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1685</guid>
		<description>sure is, i have my doubts that&#039;ll be changing anytime soon.  if you care enough go make a ruckus about how AR needs to have this functionality built into it :)</description>
		<content:encoded><![CDATA[<p>sure is, i have my doubts that&#8217;ll be changing anytime soon.  if you care enough go make a ruckus about how AR needs to have this functionality built into it :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pauliephonic</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1684</link>
		<dc:creator>pauliephonic</dc:creator>
		<pubDate>Mon, 06 Jul 2009 20:04:02 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1684</guid>
		<description>Is this patch still required for the latest version of ActiveRecord?

I, like a previous poster am using Ramaze and it&#039;s site still mentions the patch.

Cheers,  P</description>
		<content:encoded><![CDATA[<p>Is this patch still required for the latest version of ActiveRecord?</p>
<p>I, like a previous poster am using Ramaze and it&#8217;s site still mentions the patch.</p>
<p>Cheers,  P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ActiveRecord&#8217;s with_connection is now useful! &#171; coderrr</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1350</link>
		<dc:creator>ActiveRecord&#8217;s with_connection is now useful! &#171; coderrr</dc:creator>
		<pubDate>Tue, 05 May 2009 22:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1350</guid>
		<description>[...] actually to have wrap all your code in those annoying blocks, you can check out this monkeypatch (blog post here) which essentially wraps all DB touching ActiveRecord methods with with_connection for you.    [...]</description>
		<content:encoded><![CDATA[<p>[...] actually to have wrap all your code in those annoying blocks, you can check out this monkeypatch (blog post here) which essentially wraps all DB touching ActiveRecord methods with with_connection for you.    [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coderrr</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1292</link>
		<dc:creator>coderrr</dc:creator>
		<pubDate>Sun, 22 Mar 2009 09:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1292</guid>
		<description>np</description>
		<content:encoded><![CDATA[<p>np</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1291</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sun, 22 Mar 2009 08:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1291</guid>
		<description>That works great now! Thanks a lot for your help.</description>
		<content:encoded><![CDATA[<p>That works great now! Thanks a lot for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coderrr</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1290</link>
		<dc:creator>coderrr</dc:creator>
		<pubDate>Sun, 22 Mar 2009 03:20:15 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1290</guid>
		<description>Ok so after some investigation I found that because of how validations (and ActiveSupport callbacks) work, it&#039;s actually not possible to wrap a validation method.  (MIGHT be possible with some extremely dirty hax)

So the best thing here would be to just wrap AR::Base#valid?:

  ActiveRecord::Base =&gt; [:quoted_id, :valid?],

I&#039;ve also updated the file on github.</description>
		<content:encoded><![CDATA[<p>Ok so after some investigation I found that because of how validations (and ActiveSupport callbacks) work, it&#8217;s actually not possible to wrap a validation method.  (MIGHT be possible with some extremely dirty hax)</p>
<p>So the best thing here would be to just wrap AR::Base#valid?:</p>
<p>  ActiveRecord::Base =&gt; [:quoted_id, :valid?],</p>
<p>I&#8217;ve also updated the file on github.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1289</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sat, 21 Mar 2009 21:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1289</guid>
		<description>Call stack for the first error is below (the second one is much the same).

The notable difference is that you call save! which in turn calls transaction, whereas I call valid? directly, and that doesn&#039;t call transaction. My version of the patch is exactly as downloaded - no modifications.

connection called outside of cleanup_connection block
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:728:in `validates_uniqueness_of&#039;
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:400:in `validates_each&#039;
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `each&#039;
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `validates_each&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `call&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `evaluate_method&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `each&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `send&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#039;
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:277:in `run_callbacks&#039;
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:1029:in `valid_without_callbacks?&#039;
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:286:in `valid?&#039;
/Users/me/Dev/Ruby/Test_trunk/lib/crud/crud_instance_methods.rb:76:in `edit_submit&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:63:in `__send__&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:63:in `render_method&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:48:in `result_and_file&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:40:in `reaction_or_file&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:71:in `wrap_compile&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template/ezamar.rb:23:in `transform&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:115:in `uncached_render&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:39:in `render&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:11:in `stack&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:28:in `render&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/controller.rb:266:in `handle&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher/action.rb:29:in `call&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher/action.rb:28:in `catch&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher/action.rb:28:in `call&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:122:in `filter&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ordered_set.rb:49:in `each&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ordered_set.rb:49:in `__send__&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ordered_set.rb:49:in `method_missing&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:121:in `filter&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:109:in `dispatch&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:108:in `catch&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:108:in `dispatch&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:107:in `catch&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:107:in `dispatch&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:78:in `general_dispatch&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:53:in `call&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/current.rb:19:in `call&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/reloader.rb:84:in `call&#039;
/usr/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/showstatus.rb:20:in `call&#039;
/usr/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/showexceptions.rb:23:in `call&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:121:in `respond&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ramaze/state.rb:29:in `initialize&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ramaze/state.rb:29:in `new&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ramaze/state.rb:29:in `wrap&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:120:in `respond&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:111:in `call&#039;
/usr/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/handler/mongrel.rb:59:in `process&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new&#039;
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/mongrel.rb:17:in `startup&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:58:in `start&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter.rb:58:in `start_adapter&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter.rb:28:in `startup&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze.rb:95:in `start&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze.rb:94:in `each&#039;
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze.rb:94:in `start&#039;
start.rb:37</description>
		<content:encoded><![CDATA[<p>Call stack for the first error is below (the second one is much the same).</p>
<p>The notable difference is that you call save! which in turn calls transaction, whereas I call valid? directly, and that doesn&#8217;t call transaction. My version of the patch is exactly as downloaded &#8211; no modifications.</p>
<p>connection called outside of cleanup_connection block<br />
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:728:in `validates_uniqueness_of&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:400:in `validates_each&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `each&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `validates_each&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `call&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `evaluate_method&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `each&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `send&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:277:in `run_callbacks&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:1029:in `valid_without_callbacks?&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:286:in `valid?&#8217;<br />
/Users/me/Dev/Ruby/Test_trunk/lib/crud/crud_instance_methods.rb:76:in `edit_submit&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:63:in `__send__&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:63:in `render_method&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:48:in `result_and_file&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:40:in `reaction_or_file&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template.rb:71:in `wrap_compile&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/template/ezamar.rb:23:in `transform&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:115:in `uncached_render&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:39:in `render&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:11:in `stack&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/action/render.rb:28:in `render&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/controller.rb:266:in `handle&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher/action.rb:29:in `call&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher/action.rb:28:in `catch&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher/action.rb:28:in `call&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:122:in `filter&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ordered_set.rb:49:in `each&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ordered_set.rb:49:in `__send__&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ordered_set.rb:49:in `method_missing&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:121:in `filter&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:109:in `dispatch&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:108:in `catch&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:108:in `dispatch&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:107:in `catch&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:107:in `dispatch&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:78:in `general_dispatch&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/dispatcher.rb:53:in `call&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/current.rb:19:in `call&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/reloader.rb:84:in `call&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/showstatus.rb:20:in `call&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/showexceptions.rb:23:in `call&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:121:in `respond&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ramaze/state.rb:29:in `initialize&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ramaze/state.rb:29:in `new&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/snippets/ramaze/state.rb:29:in `wrap&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:120:in `respond&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:111:in `call&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/handler/mongrel.rb:59:in `process&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new&#8217;<br />
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/mongrel.rb:17:in `startup&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter/base.rb:58:in `start&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter.rb:58:in `start_adapter&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze/adapter.rb:28:in `startup&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze.rb:95:in `start&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze.rb:94:in `each&#8217;<br />
/Users/me/Dev/Ruby/RamazeGit/lib/ramaze.rb:94:in `start&#8217;<br />
start.rb:37</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coderrr</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1288</link>
		<dc:creator>coderrr</dc:creator>
		<pubDate>Sat, 21 Mar 2009 14:10:11 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1288</guid>
		<description>Below is my call chain for a validates_uniqueness_of call.  The reason I don&#039;t get a warning is because &quot;transaction&quot; is a parent in the call chain, and my monkeypatch wraps transaction with connection_cleanup.

So I&#039;m thinking if for some reason you have removed transaction from the wrapped methods, or if for some reason ActiveRecord isn&#039;t calling transaction you might get this.

Can you show the full stack trace?  Mine is:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:728:in `validates_uniqueness_of&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:400:in `validates_each&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `each&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `validates_each&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `call&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `evaluate_method&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `each&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `send&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#039;
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:277:in `run_callbacks&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:1030:in `valid_without_callbacks?&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:286:in `valid?&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:1019:in `save_without_dirty!&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/dirty.rb:87:in `save_without_transactions!&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:150:in `save!&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in `transaction&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:138:in `transaction&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:150:in `save!&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:158:in `rollback_active_record_state!&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:150:in `save!&#039;
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:991:in `create!&#039;</description>
		<content:encoded><![CDATA[<p>Below is my call chain for a validates_uniqueness_of call.  The reason I don&#8217;t get a warning is because &#8220;transaction&#8221; is a parent in the call chain, and my monkeypatch wraps transaction with connection_cleanup.</p>
<p>So I&#8217;m thinking if for some reason you have removed transaction from the wrapped methods, or if for some reason ActiveRecord isn&#8217;t calling transaction you might get this.</p>
<p>Can you show the full stack trace?  Mine is:</p>
<p>/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:728:in `validates_uniqueness_of&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:400:in `validates_each&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `each&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:397:in `validates_each&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `call&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:182:in `evaluate_method&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `each&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `send&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:90:in `run&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:277:in `run_callbacks&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:1030:in `valid_without_callbacks?&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:286:in `valid?&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:1019:in `save_without_dirty!&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/dirty.rb:87:in `save_without_transactions!&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:150:in `save!&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in `transaction&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:138:in `transaction&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:150:in `save!&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:158:in `rollback_active_record_state!&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:150:in `save!&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/validations.rb:991:in `create!&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1287</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sat, 21 Mar 2009 08:20:46 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1287</guid>
		<description>I&#039;m not using Rails, which is why I need this patch in the first place. As it happens I&#039;m using Ramaze, which is fully threaded.

It&#039;s in a customer project so I can&#039;t show code I&#039;m afraid. It&#039;s not doing anything very exciting mind you and it always logs the warning when the uniqueness validation fires. What part of the patch should be already covering that case?</description>
		<content:encoded><![CDATA[<p>I&#8217;m not using Rails, which is why I need this patch in the first place. As it happens I&#8217;m using Ramaze, which is fully threaded.</p>
<p>It&#8217;s in a customer project so I can&#8217;t show code I&#8217;m afraid. It&#8217;s not doing anything very exciting mind you and it always logs the warning when the uniqueness validation fires. What part of the patch should be already covering that case?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coderrr</title>
		<link>http://coderrr.wordpress.com/2009/01/16/monkey-patching-activerecord-to-automatically-release-connections/#comment-1286</link>
		<dc:creator>coderrr</dc:creator>
		<pubDate>Sat, 21 Mar 2009 01:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://coderrr.wordpress.com/?p=491#comment-1286</guid>
		<description>Hrm....  

What version of rails are you using?  Do you have any code you can show me?  I tried a 2.2.2 clean rails proj with a model with a validates_uniqueness_of and didn&#039;t get those warnings.

Answering whether or not you need to wrap around connection method calls for config uses, the answer is yes.  If you don&#039;t wrap it, it will still open a connection which will just sit there until your code reaches and finishes a cleanup_connection block.</description>
		<content:encoded><![CDATA[<p>Hrm&#8230;.  </p>
<p>What version of rails are you using?  Do you have any code you can show me?  I tried a 2.2.2 clean rails proj with a model with a validates_uniqueness_of and didn&#8217;t get those warnings.</p>
<p>Answering whether or not you need to wrap around connection method calls for config uses, the answer is yes.  If you don&#8217;t wrap it, it will still open a connection which will just sit there until your code reaches and finishes a cleanup_connection block.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
