> The second line can be avoided if no AR class was encountered till that > point. But it cant hurt to write it down anyway. Does this qualify for a > no-brain solution?
Not entirely. > Or should it be more creative, letting AR reconnect automatically once > after fork? I think this could be perhaps too much magic. Mysql handles > are just one kind of resources that cannot be shared. We already do magic for threads. Actually, a lot of magic. Some magic to make it work with forks wouldn't be bad. BTW, we can't just force RAILS_ROOT to expand_path as that as issues on some shared host servers with links and what not. But what we can do is look for this constant in Kernel.daemonize, if it exists, rewrite it to expand. And then just have a caveat on top of daemonize that it won't work in if expand_path won't work. -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core