THE ZEPINT NETWORK

programmer assist

Ruby Ruby XML Feeds

Ruby Questions Ruby Solutions Ruby Articles

Ruby is a reflective, dynamic, object-oriented programming language. It combines syntax inspired by Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp, Dylan, and CLU. Ruby is a single-pass interpreted language. Its official implementation is free software written in C.

Using multiple databases concurrently in a single ActiveRecord class

DiggBlinkRedditDeliciousTechnorati

question by Allen Taylor | Moderate

Hi,

I saw a previous post about hijacking the database intialization and using "establish_connection" to dynamically configure the database connection.

My question is: Is there only one connection in the connection pool for a class and, if so, won't hijacking the connection impact any other user using the same ActiveRecord class?

I have scenerio where I have data stored in multiple databases. Each database represents a different year's worth of data. I have a query screen which allows a user to select a year to limit their query.

I'd like to establish a connection to the appropriate database given the selected year, but I don't want to impact any other queries which may be in progress.

What do you think?

Thanks,

Allen

Post reply Subscriptions

Got a Ruby Question?

Just Sign Up and ask the top Ruby experts!

Search via Google

User Login

Email Address

Password

Ruby Experts

Rank Expert Points
#1 Srirangan 1500
This a list of the Top Ruby experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4650
#2 Bejaan 2950
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 550
#10 Abhishek Chatterjee 250
#11 Abels 250
#12 Huntress 150
#13 Adkron 150
#14 Yogesh 100
#15 lexxwern 100
This is a list of overall best performing experts, how many points do you have?