Thanks guys! That should keep me busy. Have fun Jens
Jim Hogue schrieb: > I just got a copy of "Rails Recipes" and I see in the index > > 15. Connecting to Multiple Databases > > I literally just got the book, so I can't give you any details, but > this might help get you to a solution. > > Note that the OT comment is probably correct as it is Rails, not > Mongrel that deals with the database. You may want to try the Rails > mailing list archives. > > - Jim > > ----- Original Message ----- > From: "Steve Midgley" <[EMAIL PROTECTED]> > To: <mongrel-users@rubyforge.org> > Sent: Tuesday, March 13, 2007 1:00 PM > Subject: Re: [Mongrel] Mongrel cluster with one app and many mysql > databases > > >> Hi, >> >> This is getting a little OT but I think you can easily switch your >> database connections by playing with which environment you're >> running >> in when the rails system starts up. This doesn't get you all the way >> to >> your solution but should point out the line of code you'll want to >> investigate. >> >> For example, if you were to start up 10 scratch Rails instances and >> had >> 10 entries in your database.yml file, one for each configuration, >> you >> could load 10 different db instances: for each one you would provide >> a >> different "RAILS_ENV" environment variable (corresponding to the >> appropriate entry in database.yml). Then you'd be running 10 >> different >> production instances with 10 dif. connections. >> >> What you want is a little trickier b/c you want to switch db >> instances >> on the fly with a single instance of Rails. But I still don't think >> this is going to be too difficult. For example, it's possible access >> an >> alternate database configuration entry with this line of code in the >> environment.rb file: >> >> config.database_configuration["development"]["database"] >> >> How and where to make the switch in an active running Rails server, >> I >> don't know, but it looks very plausible. >> >> I hope this helps get you started, >> >> Steve >> >> >> At 09:46 AM 3/13/2007, [EMAIL PROTECTED] wrote: >>> Message: 7 >>> Date: Tue, 13 Mar 2007 14:15:40 +0100 >>> From: Jens Carroll <[EMAIL PROTECTED]> >>> Subject: Re: [Mongrel] Mongrel cluster with one app and many mysql >>> databases >>> To: mongrel-users@rubyforge.org >>> Message-ID: <[EMAIL PROTECTED]> >>> Content-Type: text/plain; charset=ISO-8859-1 >>> >>> Thanks Alexey, >>> >>> I got also more and more to the point where it is clearly not a >>> mongrel >>> problem. >>> >>> Thanks for the answer, but if someone has done that before I would >>> really appreciate any pointer. >>> >>> Jens >>> >>> Alexey Verkhovsky schrieb: >>>>> convince mongrel (or the app) to switch databases on request >>> (maybe >>>> with the rails routing facilities) >>>> >>>> 10 databases with the same structure but different data? This is >>> doable. >>>> You'd have to hack it yourself, probably by replacing >>> ActiveRecord:: >>>> Base.connection with something that will internally hold 10 >>> connections >>>> and switch dynamically. >>>> >>>> None of will have anything to do with Mongrel though. Mongrel is >>> not a >>>> J2EE container, it has no notion of database connections. >>>> >>>> Alex > > > -------------------------------------------------------------------------------- > > >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Carroll Engineering Dipl.-Ing. Jens Carroll Neuköllnerstr. 2 D-71229 Leonberg, Germany Phone: +49 (0)7152 929053 FAX: +49 (0)7152 929054 _______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users