Hello,

Since nobody answered you yet, l'll try to answer your question...

> I'd like to find out if anyone can point me either to an online
> article or describe whether it is possible to setup CakePHP to use
> different database connections for different MySQL actions.
>
> eg one connection for all SELECTs and one connection for all INSERTs/
> UPDATEs and DELETEs
>
> It is going to be used in an application where MySQL replication will
> be used on the database layer.
>
> Thanks in advance.

Well, absolutely possible I guess - you can create unlimited models
for each table, like FooBarRead and FooBarSave and set useDbSchema to
different values in each of these. Still, array retrieved with
FooBarRead can be saved with FooBarSave (you might need to adjust the
Model::name and Model::alias vars). You can possibly even manipulate
connections by extending Model::find(), Model::save(), Model::del()
actions and after you set a right connection just call
parent::method(...) with proper attributes. Just take a look in
CakePHP core, it's not that much code and the dir structure in cake/
reflect the dirs in app/ in most cases... :)

BTW, the model layer for CakePHP (at least at this point, I mean
1.2.5) is not too powerful, maybe it's good to think a little about
choosing the right solution before you start coding a big project?


Regards,
Piotr

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en

Reply via email to