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!
|