From: Ollivier Robert Date: 2003-01-23T19:03:38+09:00 Subject: Re: mod_ruby: what's persistent and what's shared? [courtesy cc of this posting sent to cited author via email] In article <018b01c2c280$4634c0e0$fd01a8c0@musicbox>, Bill Kelly wrote: > You have to be aware of persistence because global variables do > persist in the Ruby interpreter running in a given httpd child > process. > > But, you can't depend on persistence, because the multiple (forked) > httpd processes that might service your request are all separate. > [Each has its "own" persistence.] Imagine you do something like this in your httpd.conf -=-=- RubyRequire common-data -=-=- and that in common-data.rb you have this: -=-=- require 'dbi' $DB = DBI.connect("dbi:mysql:foodb", "user", "password") -=-=- Will all instances of httpd share the same $DB ? Remember that it is not data created by a script or a .rhtml page, it is data created when you start the httpd server... -- Ollivier ROBERT -=- Eurocontrol EEC/ITM -=- roberto@eurocontrol.fr Usenet Canal Historique FreeBSD: The Power to Serve!