Ruben. D.
2008-May-23 21:00 UTC
[Backgroundrb-devel] Strange problem with ActiveRecord#find in worker
Hi friends, I''ve a strange problem with ActiveRecord#find in a worker, this sometimes work fine and somethimes return Nil but the SQL query is fine, I don''t know what happen, I was worked a complete day on debugging this, here is my code: http://pastie.caboo.se/201986 Very thanks for your help. Regards. -- Rub?n D?vila Santos. http://rubenonrails.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080523/fa6b4459/attachment.html>
Benjamin H. Bryant
2008-May-23 21:07 UTC
[Backgroundrb-devel] Strange problem with ActiveRecord#find in worker
Ruben, I had the same (very frustrating) problem. Im not entirely sure what it''s root is, but it seems to be due to mysql not having completely finished writing/updating before your worker attempts to find the record. Try adding a sleep(1) (or potentially even less time) in your worker method before the find. That worked for me. Ben On May 23, 2008, at 5:00 PM, Ruben. D. wrote:> Hi friends, I''ve a strange problem with ActiveRecord#find in a > worker, this sometimes work fine and somethimes return Nil but the > SQL query is fine, I don''t know what happen, I was worked a complete > day on debugging this, here is my code: > > http://pastie.caboo.se/201986 > > Very thanks for your help. > Regards. > > -- > Rub?n D?vila Santos. > http://rubenonrails.com > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080523/305e1ea9/attachment.html>