This content has been marked as final. Show 2 replies
In Oracle on Rails, it also uses ActiveRecord to connect to the Database, so that means models are allowed one connection to a database at a time, per class. In Obie Fernadez's article on OTN, here "Using More Than One Database" means you can create different models with different database connections, but you can have only one connection for each model.
Suppose we have following connections and models:
And we can defined two models with different connection enabled:
#in your model
class Forum1 < ActiveRecord::Base
self.connection = "inventory1"
class Forum2 < ActiveRecord::Base
self.connection = "inventory2"
Here in the example, we are "Using More Than One Database", but notice each model has only one connection. It is no possibility if you want to use a concurrent connections of "invetory1" and "invetory2" for Model "Forum1".
The native Rails doesn't provide such Concurrent Connections functionality, if you do want to use this feature, you have to use Dr. NIC's MMC.
I'd like to add one point for Question 2 "development:<---Question 2: what do we place in here?".
When we use the flags like inventory1:, inventory2:, they are not development: nor test: nor production:. So some default behaviors of development:, test: or production: (e.g., production: enables Cache by default) will not apply to inventory1 and inventory2. Fortunately we can tune the classes Forum1 and Forum2, they are flexible to be defined to meet our particular requirements.
Message was edited by: