On Wednesday 22 September 2010, michael_teter wrote: > I tested this in production mode, and it's _much_ faster. It's fast > enough that I'm almost certain that it's not reconnecting to the > secondary database each time (at least in production mode). I don't > know if it's just overhead of other development behaviors or if it's > actually doing things differently (with respect to connections/pools/ > reconnects); and I don't have time to investigate deeper.
Did you originally write that your problem is with behavior in development environment? I was assuming production. The reason for the behavior you notice is simple: In development environment, class caching is disabled, in other words, classes are reloaded on each request so that changes are immediately effective. An intended consequence is that class variables and class instance variables (i.e., instance variables of class objects) are re-initialized again, too. Among those being the variables that hold the database connection. Michael -- Michael Schuerig mailto:[email protected] http://www.schuerig.de/michael/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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-talk?hl=en.

