I had some issues using active record objects inside the code block. It
seems that activerecord does not allow concurrency by default, and I
up with “MySQL server has gone away” messages as a result.
I found a couple of possible fixes here
http://www.ruby-forum.com/topic/123472, and am not sure which one is
The first is just to add “ActiveRecord::Base.allow_concurrency = true”
seems to work fine for me and is certainly the simplest.
The other is to “ActiveRecord::Base.remove_connection” before forkoff!
“ActiveRecord::Base.establish_connection(dbconfig)” first thing in the
block, then “ActiveRecord::Base.establish_connection(dbconfig)” after
If the second method is better then it would probably be best added to
gem. Any advice?