<?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"
	>
<channel>
	<title>Comments for Big Dave's Blog</title>
	<atom:link href="http://davedupre.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://davedupre.com</link>
	<description>Some random thoughts - Go big or stay home!</description>
	<pubDate>Thu, 28 Aug 2008 22:37:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>Comment on Ruby Text Search by Leif</title>
		<link>http://davedupre.com/2007/08/02/ruby-text-search/#comment-239</link>
		<dc:creator>Leif</dc:creator>
		<pubDate>Tue, 05 Aug 2008 09:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2007/08/02/ruby-text-search/#comment-239</guid>
		<description>Hi Dave,

i send you an email.
"Title" is an field in the table "offers".

See'ya
Leif</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>i send you an email.<br />
&#8220;Title&#8221; is an field in the table &#8220;offers&#8221;.</p>
<p>See&#8217;ya<br />
Leif</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Text Search by Dave</title>
		<link>http://davedupre.com/2007/08/02/ruby-text-search/#comment-236</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 01 Aug 2008 13:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2007/08/02/ruby-text-search/#comment-236</guid>
		<description>Looks about the same as what I do.  The only difference I see is that use:

require 'search'

instead of

require_dependency 'search'

Is title an attribute of your Offer model?

Please dump what the log spits out when you hit the search action.  I'm curious to see what it's doing. Feel free to remove anything you don't want to be seen, or you can email it to me @ dave [at] davedupre.com.</description>
		<content:encoded><![CDATA[<p>Looks about the same as what I do.  The only difference I see is that use:</p>
<p>require &#8217;search&#8217;</p>
<p>instead of</p>
<p>require_dependency &#8217;search&#8217;</p>
<p>Is title an attribute of your Offer model?</p>
<p>Please dump what the log spits out when you hit the search action.  I&#8217;m curious to see what it&#8217;s doing. Feel free to remove anything you don&#8217;t want to be seen, or you can email it to me @ dave [at] davedupre.com.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Text Search by Leif</title>
		<link>http://davedupre.com/2007/08/02/ruby-text-search/#comment-235</link>
		<dc:creator>Leif</dc:creator>
		<pubDate>Fri, 01 Aug 2008 06:32:34 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2007/08/02/ruby-text-search/#comment-235</guid>
		<description>OK.

Controller looks like:
--------------------------------------
def search
     if params[:query]
       @offers = Offer.search(params[:query])
     else
       @offers = []
     end
  end
--------------------------------------

Model:
--------------------------------------
require_dependency "search"

class Offer &#60; ActiveRecord::Base
  searches_on :all
end
--------------------------------------

Form:
--------------------------------------
 {:action =&#62; :search} do &#124;f&#124; %&#62;



--------------------------------------

View for results:
--------------------------------------

     There were no results for your query
 
  
 
     Result: 
 

 
--------------------------------------

Thanks for your help!
See'ya
Leif</description>
		<content:encoded><![CDATA[<p>OK.</p>
<p>Controller looks like:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
def search<br />
     if params[:query]<br />
       @offers = Offer.search(params[:query])<br />
     else<br />
       @offers = []<br />
     end<br />
  end<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Model:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
require_dependency &#8220;search&#8221;</p>
<p>class Offer &lt; ActiveRecord::Base<br />
  searches_on :all<br />
end<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Form:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
 {:action =&gt; :search} do |f| %&gt;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>View for results:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>     There were no results for your query</p>
<p>     Result: </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Thanks for your help!<br />
See&#8217;ya<br />
Leif</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Text Search by Dave</title>
		<link>http://davedupre.com/2007/08/02/ruby-text-search/#comment-234</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 01 Aug 2008 02:31:23 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2007/08/02/ruby-text-search/#comment-234</guid>
		<description>I need a little more info.  Based on your comment, it looks like there is a number being loaded into something that is expected to be a model.  Please update a little bit of your code, and I can take a look.</description>
		<content:encoded><![CDATA[<p>I need a little more info.  Based on your comment, it looks like there is a number being loaded into something that is expected to be a model.  Please update a little bit of your code, and I can take a look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Text Search by Leif</title>
		<link>http://davedupre.com/2007/08/02/ruby-text-search/#comment-233</link>
		<dc:creator>Leif</dc:creator>
		<pubDate>Thu, 31 Jul 2008 20:31:36 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2007/08/02/ruby-text-search/#comment-233</guid>
		<description>Hi Dave!

I'm new to Rails and trying to build an small test app which uses your search script. At the moment i get the error
---
undefined method `title' for 0:Fixnum
---
I don't know what went wrong. Any hints?

Thanks in advance.
Leif</description>
		<content:encoded><![CDATA[<p>Hi Dave!</p>
<p>I&#8217;m new to Rails and trying to build an small test app which uses your search script. At the moment i get the error<br />
&#8212;<br />
undefined method `title&#8217; for 0:Fixnum<br />
&#8212;<br />
I don&#8217;t know what went wrong. Any hints?</p>
<p>Thanks in advance.<br />
Leif</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Background Tasks with Starling - Part 2 by Dave</title>
		<link>http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/#comment-231</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 24 Jul 2008 00:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/#comment-231</guid>
		<description>I've had it running for months without a single thread-related issue.  The trick is to make sure you have:

ActiveRecord::Base.allow_concurrency = true

when you startup your thread.  To be complete, you should also have:

ActiveRecord::Base.verify_active_connections!

at the end of your thread.

Don't ever try to have threads in your web application, but I haven't seen problems with daemons.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve had it running for months without a single thread-related issue.  The trick is to make sure you have:</p>
<p>ActiveRecord::Base.allow_concurrency = true</p>
<p>when you startup your thread.  To be complete, you should also have:</p>
<p>ActiveRecord::Base.verify_active_connections!</p>
<p>at the end of your thread.</p>
<p>Don&#8217;t ever try to have threads in your web application, but I haven&#8217;t seen problems with daemons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Background Tasks with Starling - Part 2 by graham</title>
		<link>http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/#comment-230</link>
		<dc:creator>graham</dc:creator>
		<pubDate>Wed, 23 Jul 2008 23:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/#comment-230</guid>
		<description>I'm wondering if threading is the best direction to go for this. I've been looking around, and it seems like rails/activerecord threading generally meant a world of hurt (is this view outdated?).</description>
		<content:encoded><![CDATA[<p>I&#8217;m wondering if threading is the best direction to go for this. I&#8217;ve been looking around, and it seems like rails/activerecord threading generally meant a world of hurt (is this view outdated?).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Background Tasks with Starling by Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-229</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 22 Jul 2008 11:32:06 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-229</guid>
		<description>This is a pretty common Rails issues. When you have multiple instances of a model (one in the app and one in the workling in your case), and one instance saves, the other will not see the change.  You have a couple of options.

1. Make sure to reload the model in your controller.  This may work, but timing will be a problem.  What if the workling is delayed?

2. Use a transaction and lock the model.  Just be careful with locking multiple models, you could end up with a deadlock.  If you do modify multiple models, make sure you always access them in the same order.</description>
		<content:encoded><![CDATA[<p>This is a pretty common Rails issues. When you have multiple instances of a model (one in the app and one in the workling in your case), and one instance saves, the other will not see the change.  You have a couple of options.</p>
<p>1. Make sure to reload the model in your controller.  This may work, but timing will be a problem.  What if the workling is delayed?</p>
<p>2. Use a transaction and lock the model.  Just be careful with locking multiple models, you could end up with a deadlock.  If you do modify multiple models, make sure you always access them in the same order.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Background Tasks with Starling by Raj</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-228</link>
		<dc:creator>Raj</dc:creator>
		<pubDate>Tue, 22 Jul 2008 04:09:48 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-228</guid>
		<description>Hi Dave,

              we are facing an issue while updating a model from workling.the issue is,i have a counter column in a table and i increment this from controller and decrement from workling.This counter is used for controlling  number of workling to be triggered.
The table in DB is showing the decremented value but still controller could not see the change in counter by the workling.Is this the expected behaviour of workling.
Is there any way to access the changes made to model (db table) by the controller.

Thanks in advance Kevin.</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>              we are facing an issue while updating a model from workling.the issue is,i have a counter column in a table and i increment this from controller and decrement from workling.This counter is used for controlling  number of workling to be triggered.<br />
The table in DB is showing the decremented value but still controller could not see the change in counter by the workling.Is this the expected behaviour of workling.<br />
Is there any way to access the changes made to model (db table) by the controller.</p>
<p>Thanks in advance Kevin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby Background Tasks with Starling by Dave</title>
		<link>http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-227</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Wed, 16 Jul 2008 12:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/#comment-227</guid>
		<description>No, you're not missing anything.  Certainly, if I was changing the workers then I would want them to empty out their queues before updating.  In that case, I would do:

1. Stop my application to prevent new messages
2. run stats on starling to see how many items are left to process
3. When all queues are empty, restart workling
4. Start my application

I suppose to be safest you would want this automated in the workling shutdown process.  However, if you're queues tend to be long, and you haven't changed a worker, then all you really need to do is stop all the workling threads in between a message.  The ultimate would be to have both options available.</description>
		<content:encoded><![CDATA[<p>No, you&#8217;re not missing anything.  Certainly, if I was changing the workers then I would want them to empty out their queues before updating.  In that case, I would do:</p>
<p>1. Stop my application to prevent new messages<br />
2. run stats on starling to see how many items are left to process<br />
3. When all queues are empty, restart workling<br />
4. Start my application</p>
<p>I suppose to be safest you would want this automated in the workling shutdown process.  However, if you&#8217;re queues tend to be long, and you haven&#8217;t changed a worker, then all you really need to do is stop all the workling threads in between a message.  The ultimate would be to have both options available.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
