Forum: Ruby on Rails Multiple DBs and Query Cache

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D35d964695abd1bac108370eaf001af3?d=identicon&s=25 Andrew Selder (aselder)
on 2009-02-25 21:42
(Received via mailing list)
Hi all,

I have an application where the majority of models live in one main
DB, while I have a couple model relying on data in a old DB.

So I created an abstract class for those models and called
establish_connection() to the old DB. So far so good.

I'm running some fairly repetitive queries and I noticed that some of
them were taking an excessively long time. After some digging, it
turns out that query_cache_enabled is false for all the models that
use my newly established connection. The models that use AR::Base's
connection work fine with the query cache.

Anybody know how to turn on query caching when you establish a new
connection?

Rails 2.2.2

Thanks,

Andrew
This topic is locked and can not be replied to.