> I thought the latest ActiveRecord now solicits all connections for > transactions? Maybe somehow you are creating an orphan pool after rails boots > and connects, which is right before you shim in a new connection? If so, > solving that would involve a deep code dive into a potential area that is not > advertised as configurable. >
AFAIK and from the current experience ActiveRecord isn't opening all connections. It does only on the current environment one. > Have you considered that your workflow may be better served by over riding > the db:migrate task in your own databases.rake and setting either some ENV > variables or hooks to get what you need? Rake allows you to stack tasks, your > would be last in, first run. You could even make your database.yml use ERB > and use said ENV hooks to just make the simple "development" or "test" > connection name go to the migration DBs. If indeed your issue is related to > your implementation, the exploring other options could help. In Rails3 connection() method in migrations was added in order to be able to run migrations in other databases. This also includes the case that I am working on: I prefer to have my database user for production that can only modify data, and have another user with all privileges that is only used on migrations. This is a key security concept. This way it is impossible to use a hypothetical sql injection for modifying database schema. I prefer to do The Right Thing™ and not to patch it by overriding my db:migrate task. It would be a solution, but I would like to find the root cause of this problem. I am going to dig a bit more on the code, and see if I find something interesting. Thanks for your reasoning Ken. Best regards, Rafael Fernández López. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
