<?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: Ruby on Rails: Import CSV data into database</title>
	<atom:link href="http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 18 Mar 2011 22:33:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Ashish</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-93</link>
		<dc:creator>Ashish</dc:creator>
		<pubDate>Fri, 18 Mar 2011 22:33:24 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-93</guid>
		<description>I hope this thread/message board is still active...

I&#039;ve implemented FasterCSV into my project for a long time now. Actually now I&#039;ve moved to importing XLS files and parsing the data and importing into MySQL. Problem I&#039;m running into now, after the database has become significantly large (&gt;200,000 records) is that when parsing and importing data now...rails is painfully slow. A file of about a 1000 records which previously used to take minutes...now takes at least 30. I&#039;m having major memory leaks and performance problems.
Any possible explanations or remedies? I&#039;ve gone through the code and noticed that there are several connection strings to the database which are constantly connecting and quitting..I know this is probably a big issue and I&#039;m in the process of fixing it. However, any other pointers on where I can look to increase performance and decrease memory issues?</description>
		<content:encoded><![CDATA[<p>I hope this thread/message board is still active&#8230;</p>
<p>I&#8217;ve implemented FasterCSV into my project for a long time now. Actually now I&#8217;ve moved to importing XLS files and parsing the data and importing into MySQL. Problem I&#8217;m running into now, after the database has become significantly large (&gt;200,000 records) is that when parsing and importing data now&#8230;rails is painfully slow. A file of about a 1000 records which previously used to take minutes&#8230;now takes at least 30. I&#8217;m having major memory leaks and performance problems.<br />
Any possible explanations or remedies? I&#8217;ve gone through the code and noticed that there are several connection strings to the database which are constantly connecting and quitting..I know this is probably a big issue and I&#8217;m in the process of fixing it. However, any other pointers on where I can look to increase performance and decrease memory issues?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-47</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Tue, 23 Mar 2010 23:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-47</guid>
		<description>Forgot to mention in my last comment but if you push this to a background job you should do some (rescue FasterCSV::MalformedCSVError) action. Or even better do it if not tossing to background job so you don&#039;t get app errors if users upload a file that isn&#039;t parsed perfectly.</description>
		<content:encoded><![CDATA[<p>Forgot to mention in my last comment but if you push this to a background job you should do some (rescue FasterCSV::MalformedCSVError) action. Or even better do it if not tossing to background job so you don&#8217;t get app errors if users upload a file that isn&#8217;t parsed perfectly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: /good/bad/tech</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-46</link>
		<dc:creator>/good/bad/tech</dc:creator>
		<pubDate>Tue, 23 Mar 2010 21:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-46</guid>
		<description>Thanks for the feedback.  I&#039;m glad it helped you out.</description>
		<content:encoded><![CDATA[<p>Thanks for the feedback.  I&#8217;m glad it helped you out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-45</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Fri, 19 Mar 2010 12:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-45</guid>
		<description>Just implemented for a project.  Works great.  Many thanks for the work.
 </description>
		<content:encoded><![CDATA[<p>Just implemented for a project.  Works great.  Many thanks for the work.<br />
 </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-44</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Wed, 24 Feb 2010 20:20:16 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-44</guid>
		<description>Err I meant model</description>
		<content:encoded><![CDATA[<p>Err I meant model</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-43</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Wed, 24 Feb 2010 09:34:35 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-43</guid>
		<description>In regards to moving the logic into the controller: http://gist.github.com/313281
This is just a quick example and I&#039;m not sure it would work perfect. My setup is quite a lot different, but a good  starting point.
Also error handling could be done a few ways. For me first I&#039;m using delayed_job and after a csv file is uploaded I past off the load to delayed_job b/c we have imports of 100,000 + lines. As load_csv method is looping over rows we collect errors, if any, into an array and send out the results in an email.</description>
		<content:encoded><![CDATA[<p>In regards to moving the logic into the controller: http://gist.github.com/313281<br />
This is just a quick example and I&#8217;m not sure it would work perfect. My setup is quite a lot different, but a good  starting point.<br />
Also error handling could be done a few ways. For me first I&#8217;m using delayed_job and after a csv file is uploaded I past off the load to delayed_job b/c we have imports of 100,000 + lines. As load_csv method is looping over rows we collect errors, if any, into an array and send out the results in an email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: /good/bad/tech</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-42</link>
		<dc:creator>/good/bad/tech</dc:creator>
		<pubDate>Tue, 23 Feb 2010 19:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-42</guid>
		<description>Hi John,

I&#039;m glad the post was helpful and that you already tracked down answer for the question you had.

Regards,
Spencer</description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>I&#8217;m glad the post was helpful and that you already tracked down answer for the question you had.</p>
<p>Regards,<br />
Spencer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McLeod</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-41</link>
		<dc:creator>John McLeod</dc:creator>
		<pubDate>Wed, 17 Feb 2010 18:56:47 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-41</guid>
		<description>Found it.
My routes were messed up.
map.import_proc &#039;/import/proc/id&#039;, :controller =&gt; &#039;imports&#039;, :action =&gt; &#039;proc_csv&#039;
should be...
map.import_proc &#039;/import/proc/:id&#039;, :controller =&gt; &#039;imports&#039;, :action =&gt; &#039;proc_csv&#039;
John</description>
		<content:encoded><![CDATA[<p>Found it.<br />
My routes were messed up.<br />
map.import_proc &#8216;/import/proc/id&#8217;, :controller =&gt; &#8216;imports&#8217;, :action =&gt; &#8216;proc_csv&#8217;<br />
should be&#8230;<br />
map.import_proc &#8216;/import/proc/:id&#8217;, :controller =&gt; &#8216;imports&#8217;, :action =&gt; &#8216;proc_csv&#8217;<br />
John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McLeod</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-40</link>
		<dc:creator>John McLeod</dc:creator>
		<pubDate>Wed, 17 Feb 2010 18:41:56 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-40</guid>
		<description>I can replace Line 11 with...
&lt;%= link_to &quot;process&quot;, :controller =&gt; &#039;imports&#039;, :action =&gt; &#039;proc_csv&#039;, :id =&gt; @import.id %&gt;
and everything works fine.
John</description>
		<content:encoded><![CDATA[<p>I can replace Line 11 with&#8230;<br />
&lt;%= link_to &#8220;process&#8221;, :controller =&gt; &#8216;imports&#8217;, :action =&gt; &#8216;proc_csv&#8217;, :id =&gt; @import.id %&gt;<br />
and everything works fine.<br />
John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McLeod</title>
		<link>http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/#comment-39</link>
		<dc:creator>John McLeod</dc:creator>
		<pubDate>Wed, 17 Feb 2010 16:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://goodbadtech.com/?p=43#comment-39</guid>
		<description>Hello,
Thanks for the tutorial, it helped extremely.
I do have a little problem.
The import is created but the proc_csv does not.
I get an ...
&quot;&lt;code&gt;undefined method `to_sym&#039; for nil:NilClass&quot; error on the Imports/show view - Line 11.&lt;/code&gt;
&lt;code&gt;8:
9: &lt;% else %&gt;
10:
11: &lt;%= link_to &quot;process&quot;, import_proc_path(@import.id) %&gt;
12:
13: &lt;% end %&gt;

Thank you for any help with this.

John
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Thanks for the tutorial, it helped extremely.<br />
I do have a little problem.<br />
The import is created but the proc_csv does not.<br />
I get an &#8230;<br />
&#8220;<code>undefined method `to_sym' for nil:NilClass" error on the Imports/show view - Line 11.</code><br />
<code>8:<br />
9: &lt;% else %&gt;<br />
10:<br />
11: &lt;%= link_to "process", import_proc_path(@import.id) %&gt;<br />
12:<br />
13: &lt;% end %&gt;</p>
<p>Thank you for any help with this.</p>
<p>John<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

