AR and processes


#1

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