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 can''t ever pass a reference to such object across DRb for BackgrounDrb to process)? Thanks! Philip TypeError (can''t dump): /usr/lib/ruby/1.8/drb/drb.rb:395:in `_dump'' /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' /usr/lib/ruby/1.8/pstore.rb:326:in `transaction'' /usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update'' /usr/lib/ruby/1.8/cgi/session/pstore.rb:97:in `close'' /usr/lib/ruby/1.8/cgi/session.rb:330:in `close'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: 984:in `close_session'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: 1026:in `process_cleanup_without_flash'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/flash.rb :147:in `process_cleanup_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters. rb:439:in `process_cleanup_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_ management.rb:126:in `process_cleanup_without_components'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/componen ts.rb:182:in `process_cleanup'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: 385:in `process_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters. rb:377:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_ management.rb:117:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/dispatcher.rb:38:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:115:in `handle _dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:81:in `service '' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:67:in `dispatc h'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/servers/webrick.rb:59 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc ies.rb:147:in `require'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/server.rb:30 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc ies.rb:147:in `require'' script/server:3
Hi Philip, I had similar problems due to the fact that I was storing objects of the class that included DrbUndumped in the rails session variable. I had similar looking stack traces to what you have included here. Don''t store the whole object in the session, just store the id and use find() to get the object. hth, James On 8/7/06, Philip Lipu Tsai <tsailipu at gmail.com> wrote:> 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 can''t ever pass a reference to such > object across DRb for BackgrounDrb to process)? > > Thanks! > Philip > > > TypeError (can''t dump): > /usr/lib/ruby/1.8/drb/drb.rb:395:in `_dump'' > /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' > /usr/lib/ruby/1.8/pstore.rb:326:in `transaction'' > /usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update'' > /usr/lib/ruby/1.8/cgi/session/pstore.rb:97:in `close'' > /usr/lib/ruby/1.8/cgi/session.rb:330:in `close'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: > 984:in `close_session'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: > 1026:in `process_cleanup_without_flash'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/flash.rb > :147:in `process_cleanup_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters. > rb:439:in `process_cleanup_without_session_management_support'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_ > management.rb:126:in `process_cleanup_without_components'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/componen > ts.rb:182:in `process_cleanup'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: > 385:in `process_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters. > rb:377:in `process_without_session_management_support'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_ > management.rb:117:in `process'' > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/dispatcher.rb:38:in `dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:115:in `handle > _dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:81:in `service > '' > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'' > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:67:in `dispatc > h'' > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/servers/webrick.rb:59 > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc > ies.rb:147:in `require'' > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/server.rb:30 > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc > ies.rb:147:in `require'' > script/server:3 > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-- James Hughes Web application developer Vancouver, BC "Developing a coherent political analysis is in many respects contingent upon an ability to connect one context to another, a process not dissimilar to playing the kid''s game of dot-to-dot." - Ward Churchill, from ''"A Government of Laws"?''
Thanks James! You are right on! What I have, though, was an object in the session that referenced this model object, so when accessed, this model object got stored in the session as well. Erza also pointed that out to me last night. I also am going to try to see whether instead of passing object references across DRb, simply passing the object IDs, looking them up through DB on the Worker and then manipulating them completely locally on the Worker side will be faster than marshalling/manipulating across DRb in several trips. (I guess this would be a test of DB vs marshalling.) If it turns out to be faster to manipulate through DB locally in the Worker, maybe this could become another best-practice tip to the new comers. On 8/8/06, James Hughes <hughes.james at gmail.com> wrote:> Hi Philip, > > I had similar problems due to the fact that I was storing objects of > the class that included DrbUndumped in the rails session variable. I > had similar looking stack traces to what you have included here. Don''t > store the whole object in the session, just store the id and use > find() to get the object. > > hth, > James > > On 8/7/06, Philip Lipu Tsai <tsailipu at gmail.com> wrote: > > 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 can''t ever pass a reference to such > > object across DRb for BackgrounDrb to process)? > > > > Thanks! > > Philip > > > > > > TypeError (can''t dump): > > /usr/lib/ruby/1.8/drb/drb.rb:395:in `_dump'' > > /usr/lib/ruby/1.8/pstore.rb:348:in `dump'' > > /usr/lib/ruby/1.8/pstore.rb:326:in `transaction'' > > /usr/lib/ruby/1.8/cgi/session/pstore.rb:90:in `update'' > > /usr/lib/ruby/1.8/cgi/session/pstore.rb:97:in `close'' > > /usr/lib/ruby/1.8/cgi/session.rb:330:in `close'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: > > 984:in `close_session'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: > > 1026:in `process_cleanup_without_flash'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/flash.rb > > :147:in `process_cleanup_without_filters'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters. > > rb:439:in `process_cleanup_without_session_management_support'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_ > > management.rb:126:in `process_cleanup_without_components'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/componen > > ts.rb:182:in `process_cleanup'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/base.rb: > > 385:in `process_without_filters'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/filters. > > rb:377:in `process_without_session_management_support'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session_ > > management.rb:117:in `process'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/dispatcher.rb:38:in `dispatch'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:115:in `handle > > _dispatch'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:81:in `service > > '' > > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > > /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > > /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > > /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/webrick_server.rb:67:in `dispatc > > h'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/servers/webrick.rb:59 > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc > > ies.rb:147:in `require'' > > /usr/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/commands/server.rb:30 > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'' > > /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc > > ies.rb:147:in `require'' > > script/server:3 > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > > -- > James Hughes > Web application developer > Vancouver, BC > > "Developing a coherent political analysis is in many respects > contingent upon an ability to connect one context to another, a > process not dissimilar to playing the kid''s game of dot-to-dot." > - Ward Churchill, from ''"A Government of Laws"?'' >