similar to: Passing objects to drb, does it keep the existing db connection?

Displaying 20 results from an estimated 2000 matches similar to: "Passing objects to drb, does it keep the existing db connection?"

2006 Jul 19
1
Catch 22 with after_save. Please help.
I have a pretty strange problem. Here is basically what I have to demonstrate my problem: class Event < ActiveRecord::Base def after_create AnotherClass.find_event(id) end end class AnotherClass < ActiveRecord::Base def self.find_event(event_id) e = Event.find event_id end end Here is the catch 22 and it''s quite annoying. Basically ActiveRecord puts to whole save
2006 Jul 22
1
Problem with drbundumped?
I''m not sure if this is a problem or not, but it definitely henders the way one would use the passing of objects to the drb server. Isn''t the point of passing objects to the drb server to act like its passing to just another local method? When I pass an object to the drb server a lot of the useful methods are gone. Such as id() or class () or inspect(), etc. I spent a
2006 Aug 02
9
RJS not cross browser compatible?
I have an RJS template that does the following page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' This works just find in safari and firefox. In IE and Opera it doesn''t work so great. Any ideas? Am I doing something wrong here? -- Posted via http://www.ruby-forum.com/.
2006 Aug 03
3
undefined method `'' for #<DRb::DRbUnknown:0x2501bd4>
I tried installing BackgrounDRb today. Followed the readme, made a little worker for myself and executed it within the code. But I keep getting this error. I must''ve gone over the README a zillion times. Any idea what it is? undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>
2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex class. Now that backgroundrb has allow_concurrency = true there is no need to synchronize database calls in threads. The question I have is lets say I have a simple method in my worker as follows: def some_method SomeModel.find_all each do |obj| obj.some_count += 1 obj.save! end end It accesses the database, but
2006 Jul 17
2
Very strange after_save problem. Please help.
I have a very strange problem here. I do not get this. So any help is greatly appreciated. Basically I have a model that calls a method in the background process in the "after_save" method. Let''s call the model products. So what happens is this: 1. I create a new product. 2. Everything works and the product is saved with id 13. 3. A method is called in my background
2006 Jul 05
5
''m having trouble with BackgrounDrb
Hi. I thought that BackgrounDrb was the perfect solution for my long running report production tasks. But I can''t seem to get anything useful back out of it. I set up a simple test worker that just does class TestWorker < BackgrounDRb::Rails attr_reader :pupil def do_work(args) @progress=0 @pupil=Pupil.find(3) sleep rand*10 @progress=100 end when I try to
2005 May 19
5
[OT] Sqlite2 question
So, under Sqlite2, if I want to update a database''s schema, I have to dump the DB, modify the table''s structure, then go and modify EVERY insert statement. The insert statements look like (from memory): INSERT INTO my_table VALUES (''some_id'', ''some_val'', '''', '''', '''', ''some_other
2006 Aug 08
2
"include DRbUndumped" error
Hi, I am getting my hands on trying the cool BackgrounDrb plugin. Following various discussions and suggestsion, I included "include DRbUndumped" in my ActiveRecord model. However, the following exception occurs after I tried this and hit the page that uses this model. Does anyone know why this is so? Is it possible that an object cannot be DRbUndumped (that would mean, we
2006 Jun 15
5
Cannot invoke ActiveRecord subclass accessors in DRb worker
Hi there, I''m trying to create a worker to do some asynchronous web client work and update the data model with its results. It seems, however, that every call I make to an ActiveRecord subclass causes the whole thing to block. At least I think it''s blocked. Right now I''m just using debug log output. Is there a decent way to debug/test workers I can try? Is there any
2006 Jul 17
1
RJS template help
Does anyone know where I can find good documentation on how to use RJS template. I know I can do various things with the page object: page.visual_effect :shake, ''some_id'' Is there a list of method I can run on the page onject and what parameters they are expecting? I can''t find this anywhere. Thanks for your help. Thank You, Ben Johnson E: bjohnson@contuitive.com
2006 Jul 19
1
A couple of problems
Hi Ezra, Thanks for the great work on BackgrounDRb. I have come across a couple of problems. 1. I wanted to define a simple class in the worker file to wrap up and pass back some data to my controller. It seems that if I create the class either inside or outside of my worker class (in the same file) it gets wrapper by a DRb::DRbUknown object and therefore cannot be accessed from my controller.
2006 Jul 07
4
Problems with ActiveRecord in workers
Hi *, are there some special settings except of "load_rails: true" to make ActiveRecord models accessible within my workers? I''ve just installed the latest version of this great plugin, but I keep getting undefined method [] for #<DRb::DRbUnknown:0x12345> (line 105 in backgroundrb.rb) when one of the arguments for the worker is an ActiveRecord object. I assume that
2006 Sep 05
2
question about passing array of AR objects to worker
got a wierd problem maybe someone can help with. whenever i try to pass an array or AR objects to my worker, i end up with a DRb object in the worker...here''s an example class SearchWorker < BackgrounDRb::Rails attr_reader :resources def do_work(resources) logger.info resources.inspect end end class SearchController < ApplicationController def start_search
2010 Dec 21
2
Fetch without setting flags
Hello, I'm customizing squirrelmail and I want to print a line from the message in front of the subject in mailbox listing (like gmail). the problem is, when I use 'FETCH {SOME_ID} BODY[]' the message gets marked as seen. How can I fetch without setting the senn flag ? Thanks Behrooz
2010 Jun 30
0
drb problem? ringy-dingy won't answer...
The following code works fine as long as I don''t try to run it through the distributed server. It doesn''t get there... It runs fine out of delayed_job, runs fine if called directly. But if ''distrib'' is true (the default) it runs right up to the call to the server and right past it without getting to the server or raising any errors. Am using Ruby 1.8.6.26 ,
2006 Jul 17
2
after_save deletes is an exception is raised?
Does after_save in a model delete if an exception is raised in there? I simply did def after_save raise ''hmmm'' end and it raised the exception but there was nothing in the database. I removed that entire method and its in the database. Is this correct? Thank You, Ben Johnson E: bjohnson@contuitive.com -------------- next part -------------- An HTML attachment was
2006 Aug 01
4
Creating workers from workers?
Since MiddleMan is an uninitialized constant in a worker how do you create new workers inside a worker? Thank You, Ben Johnson E: bjohnson at contuitive.com O: 800-341-6826 M: 817-229-4258 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060731/75a77fa6/attachment-0001.html
2006 Jul 19
1
Testing worker classes
Hi, Does it make sense to test a worker class by calling Middleman.new_worker? Or should I just be testing the functionality in the do_work method, with, say, a mock object. This seems like a really ugly DRY violation: you''d need to keep the code in the mock and the real worker in sync. That''s the philosophical half of my question. In fact, until someone tells me why I
2006 Jul 19
1
How to add validation to in_place_editor
I have a simple question, but can''t seem to figure this out. I added an in place editor field and didn''t like how it didn''t use the save method. It uses the update_attribute method which does not run validation, etc. So I just added the method in my controller myself: def set_event_url begin @event = Event.find params[:id] @event.url =