<?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: DB Charmer &#8211; ActiveRecord Connection Magic Plugin</title>
	<atom:link href="http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/</link>
	<description>Yet Another Admin&#039;s blog</description>
	<lastBuildDate>Thu, 04 Feb 2010 07:58:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alex Gusev</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232096</link>
		<dc:creator>Alex Gusev</dc:creator>
		<pubDate>Fri, 19 Mar 2010 20:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232096</guid>
		<description>I am not about to argue about software ( but i am quite close to that :-) ). 

I just asking, how my app will work in this typical situations if i use your plugin. Setting up test app and three db servers for testing is not superfast. 

So, thats why i am asking - you know answers already :-)</description>
		<content:encoded><![CDATA[<p>I am not about to argue about software ( but i am quite close to that <img src='http://kovyrin.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ). </p>
<p>I just asking, how my app will work in this typical situations if i use your plugin. Setting up test app and three db servers for testing is not superfast. </p>
<p>So, thats why i am asking &#8211; you know answers already <img src='http://kovyrin.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scoundrel</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232095</link>
		<dc:creator>Scoundrel</dc:creator>
		<pubDate>Fri, 19 Mar 2010 20:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232095</guid>
		<description>What environment did you run it in?
We have such a code in our project:

[cc lang=&quot;ruby&quot;]
module DbCharmer
  @@migration_connections_should_exist = Rails.env.production?
  mattr_accessor :migration_connections_should_exist
...
end
[/cc]

It means that in all environments but production, the code wouldn&#039;t require your [cci_ruby]:scraper_db[/cci_ruby] configuration to exist and would silently fall back to default configuration. If you want to change this, create an initializer with the following code:

[cc lang=&quot;ruby&quot;]
DbCharmer.migration_connections_should_exist = true
[/cc]</description>
		<content:encoded><![CDATA[<p>What environment did you run it in?<br />
We have such a code in our project:</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">module</span> DbCharmer<br />
&nbsp; @@migration_connections_should_exist = Rails.<span style="color:#9900CC;">env</span>.<span style="color:#9900CC;">production</span>?<br />
&nbsp; mattr_accessor <span style="color:#ff3333; font-weight:bold;">:migration_connections_should_exist</span><br />
...<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>It means that in all environments but production, the code wouldn&#8217;t require your <code class="codecolorer ruby dawn"><span class="ruby"><span style="color:#ff3333; font-weight:bold;">:scraper_db</span></span></code> configuration to exist and would silently fall back to default configuration. If you want to change this, create an initializer with the following code:</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DbCharmer.<span style="color:#9900CC;">migration_connections_should_exist</span> = <span style="color:#0000FF; font-weight:bold;">true</span></div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232094</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Fri, 19 Mar 2010 19:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232094</guid>
		<description>ok. now i&#039;m just confused.</description>
		<content:encoded><![CDATA[<p>ok. now i&#8217;m just confused.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232093</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Fri, 19 Mar 2010 19:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232093</guid>
		<description>ugh. this wasn&#039;t correct. Not sure where the db_magic was lost

class CreateCompetitionDeals  :scraper_db

  def self.up    
    create_table(:deals) do &#124;t&#124;
      t.string :page_url, :company_name, :company_address, :company_url, :tipping_point, :total_purchased, 
               :savings, :discount, :deal_price, :caption, :market, :fine_print, :highlights, :type
      t.boolean :strange
    end
  end

  def self.down
    drop_table :deals
  end
end</description>
		<content:encoded><![CDATA[<p>ugh. this wasn&#8217;t correct. Not sure where the db_magic was lost</p>
<p>class CreateCompetitionDeals  :scraper_db</p>
<p>  def self.up<br />
    create_table(:deals) do |t|<br />
      t.string :page_url, :company_name, :company_address, :company_url, :tipping_point, :total_purchased,<br />
               :savings, :discount, :deal_price, :caption, :market, :fine_print, :highlights, :type<br />
      t.boolean :strange<br />
    end<br />
  end</p>
<p>  def self.down<br />
    drop_table :deals<br />
  end<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232092</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Fri, 19 Mar 2010 19:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232092</guid>
		<description>sorry for formatting

class CreateCompetitionDeals  :scraper_db

  def self.up    
    create_table(:deals) do &#124;t&#124;
      t.string :page_url, :company_name, :company_address, :company_url, :total_purchased, 
               :savings, :discount, :deal_price, :caption, :market, :fine_print, :highlights, :type
      t.boolean :strange
    end
  end

  def self.down
    drop_table :deals
  end
end

-- 

after running this, the main database had a deals table with correct schema. The scraper_db was empty. Rails 2.3.4</description>
		<content:encoded><![CDATA[<p>sorry for formatting</p>
<p>class CreateCompetitionDeals  :scraper_db</p>
<p>  def self.up<br />
    create_table(:deals) do |t|<br />
      t.string :page_url, :company_name, :company_address, :company_url, :total_purchased,<br />
               :savings, :discount, :deal_price, :caption, :market, :fine_print, :highlights, :type<br />
      t.boolean :strange<br />
    end<br />
  end</p>
<p>  def self.down<br />
    drop_table :deals<br />
  end<br />
end</p>
<p>&#8211; </p>
<p>after running this, the main database had a deals table with correct schema. The scraper_db was empty. Rails 2.3.4</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scoundrel</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232091</link>
		<dc:creator>Scoundrel</dc:creator>
		<pubDate>Fri, 19 Mar 2010 19:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232091</guid>
		<description>Could you show the migration code here? We use the plugin&#039;s code (migrations part) in scribd for more than 6 months with at least one migration a day - no problems so far. 

P.S. And btw, schema_migrations table is created and maintained in the main db only.</description>
		<content:encoded><![CDATA[<p>Could you show the migration code here? We use the plugin&#8217;s code (migrations part) in scribd for more than 6 months with at least one migration a day &#8211; no problems so far. </p>
<p>P.S. And btw, schema_migrations table is created and maintained in the main db only.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232090</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Fri, 19 Mar 2010 19:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232090</guid>
		<description>Migrations don&#039;t run as expected. Specified a global connection change for the migration and it ran in both the standard &amp; non-default DB. The table in the standard DB was correct. The table&#039;s schema in the non-default was empty.</description>
		<content:encoded><![CDATA[<p>Migrations don&#8217;t run as expected. Specified a global connection change for the migration and it ran in both the standard &amp; non-default DB. The table in the standard DB was correct. The table&#8217;s schema in the non-default was empty.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scoundrel</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232088</link>
		<dc:creator>Scoundrel</dc:creator>
		<pubDate>Fri, 19 Mar 2010 13:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232088</guid>
		<description>I&#039;m a mysql dba and I&#039;m convinced that these kinds of problems should not be solved in the application layer. But if someone would implement something like a slaves pool with automatic dead slaves rejection, I&#039;d accept the patch as soon as it is tested in production somewhere.</description>
		<content:encoded><![CDATA[<p>I&#8217;m a mysql dba and I&#8217;m convinced that these kinds of problems should not be solved in the application layer. But if someone would implement something like a slaves pool with automatic dead slaves rejection, I&#8217;d accept the patch as soon as it is tested in production somewhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Gusev</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232087</link>
		<dc:creator>Alex Gusev</dc:creator>
		<pubDate>Fri, 19 Mar 2010 10:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232087</guid>
		<description>It is completely amazing! Such sweet plugin that tested at scribd production... Brilliant!

But, i have three questions:

What will happen when i have:
1) 1 master db and 1 slave db for model and slave going down?
2) 1 master db and 1 slave db for model and master going down?
3) 1 master db and 2 slaves db for model and 1 slave going down?</description>
		<content:encoded><![CDATA[<p>It is completely amazing! Such sweet plugin that tested at scribd production&#8230; Brilliant!</p>
<p>But, i have three questions:</p>
<p>What will happen when i have:<br />
1) 1 master db and 1 slave db for model and slave going down?<br />
2) 1 master db and 1 slave db for model and master going down?<br />
3) 1 master db and 2 slaves db for model and 1 slave going down?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scoundrel</title>
		<link>http://kovyrin.net/2009/11/03/db-charmer-activerecord-connection-magic-plugin/comment-page-1/#comment-232086</link>
		<dc:creator>Scoundrel</dc:creator>
		<pubDate>Fri, 19 Mar 2010 00:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://kovyrin.net/?p=324#comment-232086</guid>
		<description>1) YourModel.on_master.find(...) - will make the query run on the master

2) Transactions - supported and all the queries will go to the master as well (forgot to mention it in the docs though).</description>
		<content:encoded><![CDATA[<p>1) YourModel.on_master.find(&#8230;) &#8211; will make the query run on the master</p>
<p>2) Transactions &#8211; supported and all the queries will go to the master as well (forgot to mention it in the docs though).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
