Forum: Ruby on Rails AR and processes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
gerret.apelt (Guest)
on 2005-11-18 18:28
(Received via mailing list)
I'm forking a process and then doing db-interaction with AR instances,
both in the forked process and its parent.

In the code that forks, I'm calling
ActiveRecord::Base.establish_connection, and I'm calling the same
class method in the parent process, right after the fork call.

Is this the correct approach to ensure that my AR instances will
behave properly in both processes, the parent and the child?

If anybody is willing to share the theory of what's going on behind
the scenes, I'd be interested. Are class variables (i.e., the
connection) process-specific? I'm Using mysql/linux.

cheers
Gerret
This topic is locked and can not be replied to.