Multiple DBs and Query Cache


#1

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