How to use DB slave for reading and dbmaster for writing in ActiveRecord


I have planned to use Slave DB for reading and Master DB for writing in ActiveRecord.

Is it possible? if yes, how to do that?



You already posted that question few days ago… did you forget that?

Here it is -

Oh yes, I forgot it, Sorry

But I have already seen that extension dbreadwritesplitting. It is only for configuring slave connection right?

I want that how to use the slave connection in ActiveRecord while calling functions like find(), findAll()?

As you have seen… this is not implemented currently in Yii… you can take that extension as a starting point and make what you need…

Configure this extension as default db component,ActiveRecord will automatically use this component as db read write execute intrance .So it already does all jobs actually.